I am starting a new process using the following code:
Process p = new Process(); p.StartInfo.FileName = "..."; p.StartInfo.Arguments = "..."; p.Start(); p.WaitForExit(300000); // 5 minutes if (!p.HasExited) p.Kill(); Console.Write(p.ExitCode);
When the process completes within 5 minutes, it works, but when it is not, I get
InvalidOperationException (the process must exit before the request information can be determined ...).
Any idea why I get this exception?
Thanks.
source share