Build in Windows 10 won't Run #115

Closed
opened 2026-01-29 16:31:18 +00:00 by claunia · 12 comments
Owner

Originally created by @srameh on GitHub (Jan 22, 2018).

Originally assigned to: @GregorBiswanger on GitHub.

I managed to build the Demo app. It successfully builds the output folder at: ElectronNetApp\obj\desktop\win but when it go to bin folder and try to open the ElectronNetApp.exe
it only opens a console window with:
Hosting environment: Production
Content root path: D:\Temp\ElectronNetApp\ElectronNetApp\obj\desktop\win\bin
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.

Am I missing a step here? There is not enough documentation for Building and Packaging an Electron.NET App. It would help a lot if that can be added.

Originally created by @srameh on GitHub (Jan 22, 2018). Originally assigned to: @GregorBiswanger on GitHub. I managed to build the Demo app. It successfully builds the output folder at: ElectronNetApp\obj\desktop\win but when it go to bin folder and try to open the ElectronNetApp.exe it only opens a console window with: Hosting environment: Production Content root path: D:\Temp\ElectronNetApp\ElectronNetApp\obj\desktop\win\bin Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down. Am I missing a step here? There is not enough documentation for Building and Packaging an Electron.NET App. It would help a lot if that can be added.
Author
Owner

@robertmuehsig commented on GitHub (Jan 22, 2018):

If you are using the demoapp from this repository you should be able to invoke "buildAll.cmd" (inside the root folder), which should build the API/CLI and at the end the WebApp is build via "dotnet electronize build"

When everything is done (it may take a while because of nuget/npm) you should be able to start the generated .exe from this folder:
"REPODIR\ElectronNET.WebApp\bin\desktop\win\ElectronNET.Host-win32-x64\ElectronNET.Host.exe"

However: I tried it myself 5 minutes ago and somehow the console during build hangs sometimes - not sure why :-/

@robertmuehsig commented on GitHub (Jan 22, 2018): If you are using the demoapp from this repository you should be able to invoke "buildAll.cmd" (inside the root folder), which should build the API/CLI and at the end the WebApp is build via "dotnet electronize build" When everything is done (it may take a while because of nuget/npm) you should be able to start the generated .exe from this folder: "REPODIR\ElectronNET.WebApp\bin\desktop\win\ElectronNET.Host-win32-x64\ElectronNET.Host.exe" However: I tried it myself 5 minutes ago and somehow the console during build hangs sometimes - not sure why :-/
Author
Owner

@GregorBiswanger commented on GitHub (Jan 23, 2018):

I tried it and it worked...

Mhhh.. are you following the same steps?

$ git clone https://github.com/ElectronNET/electron.net-api-demos.git
$ cd electron.net-api-demos
$ cd ElectronNET-API-Demos
$ dotnet restore
$ dotnet electronize start

What Node, .NET Core and Windows 10 Version do you use?

@GregorBiswanger commented on GitHub (Jan 23, 2018): I tried it and it worked... Mhhh.. are you following the same steps? ``` $ git clone https://github.com/ElectronNET/electron.net-api-demos.git $ cd electron.net-api-demos $ cd ElectronNET-API-Demos $ dotnet restore $ dotnet electronize start ``` What Node, .NET Core and Windows 10 Version do you use?
Author
Owner

@YoussefRekik commented on GitHub (Jan 25, 2018):

Since last week I am running into the same problem
dotnet electronize start works fine but the build command fails

npm WARN ElectronNET.Host@1.0.0 No description
npm WARN ElectronNET.Host@1.0.0 No repository field
added 195 packages in 19.322s

and that's it : the cmdline is stuck at this point. Running the .exe like @srameh produces only a console window.
@GregorBiswanger did you manage to get Sqlite working with this ? It didn't work for me.

@YoussefRekik commented on GitHub (Jan 25, 2018): Since last week I am running into the same problem dotnet electronize start works fine but the build command fails ``` npm WARN ElectronNET.Host@1.0.0 No description npm WARN ElectronNET.Host@1.0.0 No repository field added 195 packages in 19.322s ``` and that's it : the cmdline is stuck at this point. Running the .exe like @srameh produces only a console window. @GregorBiswanger did you manage to get Sqlite working with this ? It didn't work for me.
Author
Owner

@srameh commented on GitHub (Jan 26, 2018):

@GregorBiswanger the steps you listed works. I can start it but the build fails.
I am also trying to build an app with Sqlite in it. Please let me know support for Sqlite is added.

@srameh commented on GitHub (Jan 26, 2018): @GregorBiswanger the steps you listed works. I can start it but the build fails. I am also trying to build an app with Sqlite in it. Please let me know support for Sqlite is added.
Author
Owner

@grahamehorner commented on GitHub (Feb 3, 2018):

I also have the same issue ?

@grahamehorner commented on GitHub (Feb 3, 2018): I also have the same issue ?
Author
Owner

@grahamehorner commented on GitHub (Feb 3, 2018):

dotnet electronize start

Microsoft (R) Build Engine version 15.5.180.51428 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 47.02 ms for
Restore completed in 109.58 ms for

node_modules missing in:
Start npm install...

Microsoft Windows [Version 10.0.16299.192]
(c) 2017 Microsoft Corporation. All rights reserved.
npm install
'npm' is not recognized as an internal or external command,

operable program or batch file.
Invoke electron.cmd - in dir: \ElectronNET.WebApp\obj\Host\node_modules.bin

Unhandled Exception: System.AggregateException: One or more errors occurred. (The directory name is invalid) ---> System.ComponentModel.Win32Exception: The directory name is invalid
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)
at ElectronNET.CLI.Commands.StartElectronCommand.b__9_0()
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at ElectronNET.CLI.Program.Main(String[] args)

@grahamehorner commented on GitHub (Feb 3, 2018): dotnet electronize start Microsoft (R) Build Engine version 15.5.180.51428 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Restore completed in 47.02 ms for Restore completed in 109.58 ms for node_modules missing in: Start npm install... Microsoft Windows [Version 10.0.16299.192] (c) 2017 Microsoft Corporation. All rights reserved. **npm install 'npm' is not recognized as an internal or external command,** operable program or batch file. Invoke electron.cmd - in dir: \ElectronNET.WebApp\obj\Host\node_modules\.bin Unhandled Exception: System.AggregateException: One or more errors occurred. (The directory name is invalid) ---> System.ComponentModel.Win32Exception: The directory name is invalid 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) at ElectronNET.CLI.Commands.StartElectronCommand.<ExecuteAsync>b__9_0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at ElectronNET.CLI.Program.Main(String[] args)
Author
Owner

@MtMovo commented on GitHub (Feb 6, 2018):

I'm also experiencing this issue. I was able to narrow it down to the Startup class code:

var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
         {
                Width = 1152,
                Height = 864,
                Show = false
            });

            browserWindow.OnReadyToShow += () => browserWindow.Show();
            browserWindow.SetTitle("Electron.NET API Demos");

If i use this piece of code, it doesn't start. However if i just use :

Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());

it does.

It breaks down to the Show property. If set to false, the app will not be shown.
Or maybe the OnReadyToShow is not actually triggered?
Any thoughts?

@MtMovo commented on GitHub (Feb 6, 2018): I'm also experiencing this issue. I was able to narrow it down to the Startup class code: ``` var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { Width = 1152, Height = 864, Show = false }); browserWindow.OnReadyToShow += () => browserWindow.Show(); browserWindow.SetTitle("Electron.NET API Demos"); ``` If i use this piece of code, it doesn't start. However if i just use : `Task.Run(async` () => await `Electron.WindowManager.CreateWindowAsync());` it does. It breaks down to the `Show` property. If set to `false`, the app will not be shown. Or maybe the `OnReadyToShow` is not actually triggered? Any thoughts?
Author
Owner

@kevinhiltb9 commented on GitHub (Feb 7, 2018):

@grahamehorner Have you installed npm on your machine? It is not a part of Electron.NET.
@YoussefRekik @srameh I'm unsure what your issues are, but the SQLite dll doesn't get included when Electron.NET builds the application. Download it from https://www.sqlite.org/download.html, rename it e_sqlite.dll, and put it in the same directory as the application executable. This solved the only issue I encountered with SQLite.

@kevinhiltb9 commented on GitHub (Feb 7, 2018): @grahamehorner Have you installed npm on your machine? It is not a part of Electron.NET. @YoussefRekik @srameh I'm unsure what your issues are, but the SQLite dll doesn't get included when Electron.NET builds the application. Download it from https://www.sqlite.org/download.html, rename it e_sqlite.dll, and put it in the same directory as the application executable. This solved the only issue I encountered with SQLite.
Author
Owner

@BrainSlugs83 commented on GitHub (Apr 13, 2018):

@GregorBiswanger those commands fail for me at the last step ("dotnet electronize start"), with:

d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos>dotnet electronize start
Start Electron Desktop Application...
Microsoft Windows [Version 10.0.16299.309]
(c) 2017 Microsoft Corporation. All rights reserved.
d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos>dotnet publish -r win-x64 --output "d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\bin"
Microsoft (R) Build Engine version 15.6.82.30579 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
  Restore completed in 103.62 ms for d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\ElectronNET-API-Demos.csproj.
  Restore completed in 126.12 ms for d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\ElectronNET-API-Demos.csproj.
  Restore completed in 71.22 ms for d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\ElectronNET-API-Demos.csproj.
  ElectronNET-API-Demos -> d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\bin\Debug\netcoreapp2.0\win-x64\ElectronNET-API-Demos.dll
  ElectronNET-API-Demos -> d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\bin\
d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos>
Skip npm install, because node_modules directory exists in: d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\node_modules
Invoke electron.cmd - in dir: d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\node_modules\.bin
Microsoft Windows [Version 10.0.16299.309]
(c) 2017 Microsoft Corporation. All rights reserved.
d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\node_modules\.bin>electron.cmd "..\..\main.js"
'electron.cmd' is not recognized as an internal or external command,
operable program or batch file.
d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\node_modules\.bin>

Something about a missing electron.cmd file. :(

@BrainSlugs83 commented on GitHub (Apr 13, 2018): @GregorBiswanger those commands fail for me at the last step ("dotnet electronize start"), with: ``` d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos>dotnet electronize start Start Electron Desktop Application... Microsoft Windows [Version 10.0.16299.309] (c) 2017 Microsoft Corporation. All rights reserved. d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos>dotnet publish -r win-x64 --output "d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\bin" Microsoft (R) Build Engine version 15.6.82.30579 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Restore completed in 103.62 ms for d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\ElectronNET-API-Demos.csproj. Restore completed in 126.12 ms for d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\ElectronNET-API-Demos.csproj. Restore completed in 71.22 ms for d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\ElectronNET-API-Demos.csproj. ElectronNET-API-Demos -> d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\bin\Debug\netcoreapp2.0\win-x64\ElectronNET-API-Demos.dll ElectronNET-API-Demos -> d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\bin\ d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos> Skip npm install, because node_modules directory exists in: d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\node_modules Invoke electron.cmd - in dir: d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\node_modules\.bin Microsoft Windows [Version 10.0.16299.309] (c) 2017 Microsoft Corporation. All rights reserved. d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\node_modules\.bin>electron.cmd "..\..\main.js" 'electron.cmd' is not recognized as an internal or external command, operable program or batch file. d:\projects.git\electron.net-api-demos\ElectronNET-API-Demos\obj\Host\node_modules\.bin> ``` Something about a missing `electron.cmd` file. :(
Author
Owner

@GregorBiswanger commented on GitHub (Apr 16, 2018):

Hi @BrainSlugs83
do you tried the new 0.0.9 Version?

@GregorBiswanger commented on GitHub (Apr 16, 2018): Hi @BrainSlugs83 do you tried the new 0.0.9 Version?
Author
Owner

@srameh commented on GitHub (Apr 22, 2018):

@kevinhiltb9 I followed your instruction but still get this error:
DllNotFoundException: Unable to load DLL 'e_sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
SQLitePCL.SQLite3Provider_e_sqlite3+NativeMethods.sqlite3_libversion_number()

@srameh commented on GitHub (Apr 22, 2018): @kevinhiltb9 I followed your instruction but still get this error: DllNotFoundException: Unable to load DLL 'e_sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E) SQLitePCL.SQLite3Provider_e_sqlite3+NativeMethods.sqlite3_libversion_number()
Author
Owner

@srameh commented on GitHub (Apr 22, 2018):

@kevinhiltb9
I managed to fix it. I had the wrong version of DLL file for sqlite3. Then the path to DB was not accessible. After fixing that all is working fine now. Thank you very much!

@srameh commented on GitHub (Apr 22, 2018): @kevinhiltb9 I managed to fix it. I had the wrong version of DLL file for sqlite3. Then the path to DB was not accessible. After fixing that all is working fine now. Thank you very much!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#115