title: InvalidOperationException with Process
body: <p>I'm starting a new process using the following code:</p>
  
  <pre><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);
  </code></pre>
  
  <p>When the process ends within the 5 minutes, that's working, but when it doesn't, I get</p>
  
  <blockquote>
    <p>InvalidOperationException (Process must exit before requested
    information can be determined...).</p>
  </blockquote>
  
  <p>Any idea why I'm getting this exception? </p>
  
  <p>Thank you.</p>