How to kill a process without getting a “process has exited” exception?
You could P/Invoke TerminateProcess passing it Process.Handle. Then manually evaluating the cause of it (GetLastError()). Which is roughly, what Process.Kill() does internally. But note that TerminateProcess is asynchronous. So you’d have to wait on the process handle to be sure it is done. Using Process.Kill() does that for your. Update: Correction, Process.Kill() also runs asynchronously. … Read more