I would like to start a process from my application with Process.Start() and I would like that in case of my app crash or the user close it then the child process is automatically killed.
Is it possible to obtain something like this?
You can use the AppDomain.ProcessExit
event to catch when your process is about to exit and have it kill the other process. I am unsure as to how it works in reaction to an unhandled exception, so you may have to use AppDomain.UnhandledException
and have it use FailFast to handle any normal exceptions. As part of that handler, you have it kill the other process too.