I’ve written a service in c# that starts different other (child)processes which run in background. How can I close a process in a graceful way? Process.kill() is not an option, and Process.CloseMainWindow() does not work because the child process has no visible window (and shouldn’t have any) .
Tanks for your help.
If you control that other process you can use WCF to communicate between processes, child process should check and ask service if is time to end process and then child process can do close and do needed cleanup. Here is a clean and simple example
http://www.switchonthecode.com/tutorials/wcf-tutorial-basic-interprocess-communication