Electron.NET icon indicating copy to clipboard operation
Electron.NET copied to clipboard

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

Open The-MAZZTer opened this issue 4 years ago • 2 comments

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

The-MAZZTer avatar Apr 15 '21 21:04 The-MAZZTer

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 avatar Apr 15 '21 21:04 The-MAZZTer

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 avatar May 27 '21 01:05 zenith6495

🎉🚀 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 avatar Mar 28 '23 15:03 GregorBiswanger