mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Electron host hangs if ASP.NET Core app crashes before connecting bridge #657
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 @The-MAZZTer on GitHub (Apr 15, 2021).
Originally assigned to: @GregorBiswanger on GitHub.
.NET Core 3.1
If your ASP.NET Core app crashes before connecting to Electron.NET, the electron host will just sit around and wait. No error message is displayed, it's not possible to debug, etc.
The short term fix for this would be to have electron host monitor the asp.net core process to see if it exits. If the process exits, electron host should shut everything else down as well.
In addition electron host should pull from stdout and stderr of the asp.net core process and display it in the console so the developer can see any error messages. Currently, stdout is sent over the IO bridge... which is only initialized once ASP.NET Core is. While it's good practice to do this right away,, apps can technically do other stuff before then.
The long term fix I think is to make ASP.NET Core the root process and have it launch electron host, instead of the other way around, since this makes debugging the ASP.NET Core process easier and would allow VS to catch and display any exceptions that would cause a crash on launch.
@The-MAZZTer commented on GitHub (Apr 15, 2021):
It's also worth noting if you close the electronize console at this point, Electron remains running and you have to go into Task Manager to kill it. Normally electron closes down when you close the electronize console.
@zenith6495 commented on GitHub (May 27, 2021):
hi have you tried version V11.5.1 to see if this issue still persist? I was using V5.22.14 all the while and having this issue, once upgraded to V11.5.1 seems like won't crash anymore.
By the way, due to some reason I might need to downgrade back to V5.22.14. How can I the short term fixed you mentioned above?
@GregorBiswanger commented on GitHub (Mar 28, 2023):
🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉
With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!