electronize start Exception (Directory not Exists) #548

Closed
opened 2026-01-29 16:42:42 +00:00 by claunia · 1 comment
Owner

Originally created by @TheKitro on GitHub (Aug 6, 2020).

Hi
I get an exception after execute: electronize start

Invoke electron.cmd - in dir: .......\obj\Host\node_modules\.bin
Unhandled exception. System.AggregateException: One or more errors occurred. (Der Verzeichnisname ist ungültig.)
 ---> System.ComponentModel.Win32Exception (267): Der Verzeichnisname ist ungültig.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at ElectronNET.CLI.ProcessHelper.CmdExecute(String command, String workingDirectoryPath, Boolean output, Boolean waitForExit) in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\ProcessHelper.cs:line 81
   at ElectronNET.CLI.Commands.StartElectronCommand.<ExecuteAsync>b__15_0() in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\Commands\StartElectronCommand.cs:line 147
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at ElectronNET.CLI.Program.Main(String[] args) in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\Program.cs:line 59

I created a Project of Type: ASP.Net Core Webapplication with .Net Core 3.1 an Webapplication Model-View-Controller Style
Added the Electron.net in Nuget.
Then I inserted:

public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseElectron(args); //new Line
                    webBuilder.UseStartup<Startup>();
                });

and

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });

            // Open the Electron-Window here
            Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());//New Line
        }

No Errors in the Syntax after inserting the usings.
Compiling works but I can't run it.
In the Console I change the Path to the Directory with *.csproj file and run: electronize init
It works
Last I run: electronize start
Then I get the Exception.
It looks like I didn't have the Path: ...\node_modules\.bin

Any Idea?
Best Regards

Originally created by @TheKitro on GitHub (Aug 6, 2020). Hi I get an exception after execute: electronize start ``` Invoke electron.cmd - in dir: .......\obj\Host\node_modules\.bin Unhandled exception. System.AggregateException: One or more errors occurred. (Der Verzeichnisname ist ungültig.) ---> System.ComponentModel.Win32Exception (267): Der Verzeichnisname ist ungültig. at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at ElectronNET.CLI.ProcessHelper.CmdExecute(String command, String workingDirectoryPath, Boolean output, Boolean waitForExit) in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\ProcessHelper.cs:line 81 at ElectronNET.CLI.Commands.StartElectronCommand.<ExecuteAsync>b__15_0() in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\Commands\StartElectronCommand.cs:line 147 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task`1.get_Result() at ElectronNET.CLI.Program.Main(String[] args) in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\Program.cs:line 59 ``` I created a Project of Type: ASP.Net Core Webapplication with .Net Core 3.1 an Webapplication Model-View-Controller Style Added the Electron.net in Nuget. Then I inserted: ``` public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseElectron(args); //new Line webBuilder.UseStartup<Startup>(); }); ``` and ``` public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); // Open the Electron-Window here Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());//New Line } ``` No Errors in the Syntax after inserting the usings. Compiling works but I can't run it. In the Console I change the Path to the Directory with *.csproj file and run: electronize init It works Last I run: electronize start Then I get the Exception. It looks like I didn't have the Path: ...\node_modules\\.bin Any Idea? Best Regards
claunia added the bug label 2026-01-29 16:42:42 +00:00
Author
Owner

@TheKitro commented on GitHub (Aug 6, 2020):

Found the Solution. I have to install node.js

@TheKitro commented on GitHub (Aug 6, 2020): Found the Solution. I have to install node.js
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#548