Electron host hangs if ASP.NET Core app crashes before connecting bridge #657

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

Originally created by @The-MAZZTer on GitHub (Apr 15, 2021).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version:
  • 9.23.1 (latest version compatible with .NET Core 3.1)

.NET Core 3.1

  • Target:
  • Windows

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.

Originally created by @The-MAZZTer on GitHub (Apr 15, 2021). Originally assigned to: @GregorBiswanger on GitHub. * **Version**: * 9.23.1 (latest version compatible with .NET Core 3.1) .NET Core 3.1 * **Target**: * Windows 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.
claunia added the bug label 2026-01-29 16:45:18 +00:00
Author
Owner

@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.

@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.
Author
Owner

@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?

@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?
Author
Owner

@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!

@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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#657