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 #654
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.