Hello - I'm impressed by the great work in this project and I hope it will continue to evolve 馃憣. I'm playing around with a ASP.NET Core app, very similar to the demo app in this repo. When I stop the application after starting it from Visual Studio (Windows) there are still node process(es) running. I'm wondering if this is an known issue or if it is I who miss to make some call/dispose some resource in order to signal to Node that the web app has shut down.
Keep up the good work!
Sound a lot like this issue:
https://github.com/ElectronNET/Electron.NET/issues/68
You are right @AirLancer - they are probably related. Worth noting is that I do this before shutting down the ASP.NET application
ElectronNET.API.Electron.App.Quit();
I am still having this problem, Is there any solution?
I try to release a new version of the API as well - @GregorBiswanger told me, that there might be a fix included.
@pardahlman, @Jonatthu, @pardahlman - do you try out the newest version of API and CLI (0.0.9)?
Hi, @GregorBiswanger - not yet (I didn't know it included a potential fix for this!). Will upgrade later today and report back to you. Thanks!
0.0.9 is definitely more stable - thanks a bunch!
I have version 0.0.9 and have this issue
@flakron What OS do you use?
Sorry, should've left more information.
OS: Ubuntu 16.04,
Dotnet SDK version: 2.1.4
The backend doesn't seem to get that the windows is closed and keeps running in background.

After running & closing 5 times using v0.0.9 . Backend does contain threads but I do know from earlier versions and standalone backend that they stop correctly when told so. I use both OnClose/OnClosed to close the threads running within the back-end.
A simple hack that i can think of is just literally starting a kill command for the back-end process... but that still doesn't tell electron to close.
Edit: welp, i gave up and went directly to main.js file, and adding this fixed it:
app.on('window-all-closed', app.quit);
app.on('before-quit', () => {
apiProcess.kill();
});
Fixed with the next Electron.NET update.
FWIW, I am still seeing this error.
I have a main menu where the user clicks File -> Exit (I only have 1 window)
public void FileExit()
{
Console.WriteLine("File exit");
var mainWindow = Electron.WindowManager.BrowserWindows.First();
mainWindow.Close();
}
And then I have an event listener which is attached the app first starts:
Electron.App.WindowAllClosed += () =>
{
Console.WriteLine("All windows closed");
Electron.IpcMain.RemoveAllListeners("EventListItem.Click");
Electron.IpcMain.RemoveAllListeners("JsonEditor.Save");
Electron.App.Quit();
};
I am taking extra care to manually remove all event listeners to ensure this isn't the reason why it fails.
What happens is, the window closes, and the electron process goes away, but the API process remains in the task manager (Activity Monitor on Mac OSX).
This is happening after a /target macosx release using the release version, and with electronize start.
It looks to me like the Click callback to MenuItem with name "exit" is not being called, maybe
public void FileExit()
{
Console.WriteLine("File exit");
var mainWindow = Electron.WindowManager.BrowserWindows.First();
mainWindow.Close();
}
public void RenderMainMenu()
{
Console.WriteLine("Rendering main menu...");
var menu = new MenuItem[]
{
new MenuItem
{
Label = "File",
Submenu = new MenuItem[]
{
new MenuItem
{
Label = "Test File Menu",
Click = () => Console.WriteLine("Test menu item clicked.")
},
new MenuItem
{
Label = "Exit",
Role = MenuRole.close,
Click = () =>
{
Console.WriteLine("Exiting program...");
FileExit();
}
}
}
},
This console.log does not occur. If I rename "Exit" to "Go Away", the Click handler does get called, window closes, but the application remains open
After running & closing 5 times using v0.0.9 . Backend does contain threads but I do know from earlier versions and standalone backend that they stop correctly when told so. I use both OnClose/OnClosed to close the threads running within the back-end.A simple hack that i can think of is just literally starting a kill command for the back-end process... but that still doesn't tell electron to close.
Edit: welp, i gave up and went directly to main.js file, and adding this fixed it:
app.on('window-all-closed', app.quit); app.on('before-quit', () => { apiProcess.kill(); });
Can you share where that variable "app" came from in your site.js?