Reputation: 2116
I want to restart a program.
I've found the process and have called Kill method, then i've runned it again:
process.Kill();
process.Start();
It stops but doesn't start.
Also if I put Exited event it never fires.
What's the problem?
Upvotes: 4
Views: 6223
Reputation: 13410
Process.Kill()
is asynchronous. You need to call Process.WaitForExit()
after calling kill.
Upvotes: 8