mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
exe does not automatically exit when run from a Windows command prompt #984
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @icnocop on GitHub (Aug 21, 2025).
9a615ca7e0Steps to Reproduce:
mainbranchhttps://github.com/ElectronNET/Electron.NET.gitElectronNET.slnin Visual Studio 2022 and Build in theDebug | Any CPUsolution configuration.cd .\src\ElectronNET.WebApp"..\ElectronNET.CLI\bin\Debug\net8.0\dotnet-electronize.exe" build /target win /dotnet-configuration Debug /p:SelfContained=false /p:BuildProjectReferences=falsecd .\src\ElectronNET.WebApp\bin\Desktop\win-unpacked"ElectronNET API Demos.exe"Ctrl+Cto close the process.The issue also occurs if I try to exit the program even before calling
Electron.WindowManager.CreateWindowAsync.I expected the process to exit when all windows are closed, since
Electron.WindowManager.IsQuitOnWindowAllClosedis set totrueby default.If I double-click the exe from Windows Explorer, the issue doesn't occur.
As other issues mention, I even tried:
Seems related, but the issues are closed, and don't mention running on the command line:
https://github.com/ElectronNET/Electron.NET/issues/68
https://github.com/ElectronNET/Electron.NET/issues/226
https://github.com/ElectronNET/Electron.NET/issues/338
https://github.com/ElectronNET/Electron.NET/issues/346
https://github.com/ElectronNET/Electron.NET/issues/364
https://github.com/ElectronNET/Electron.NET/issues/594
Thank you.
@icnocop commented on GitHub (Aug 22, 2025):
It seems the exe actually exits, but the way the command prompt looks is misleading.
I found two "work-arounds" which make the command prompt behave as expected:
set ELECTRON_NO_ATTACH_CONSOLE=1before running the exe, but this prevents any output to be written to the console.cmd.exe /c ElectronApp.exe@FlorianRappl commented on GitHub (Oct 31, 2025):
Outdated - use
ElectronNET.CoreandElectronNET.Core.AspNet.See Wiki / What's New.