I have simple C# console app that is starting a chrome process via this simple code :
var chromeProcess = Process.Start(chromeLocation, chromeArguments);
Currently when I close my app, the chrome process stays open. What i need is to close the chrome process everytime my console app is closed. Even better would be if the chrome process would be closed even when app crashes or is force killed. Is there a way to accomplish this ? I tried listening to
AppDomain.CurrentDomain.ProcessExit
but it doesn't fire (and even then, it would not work in event of crash or force fill). I need this to work on Windows 7 and up - I found a lot of solutions for Win XP only.
Thanks