Reading standard output from process, always empty
<p>Running this code:</p>

<pre><code>Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = "tool.exe";
p.Start();
p.WaitForExit();
</code></pre>

<p>Makes tool.exe run, and output some content on standard output. However, if I try to capture the content using:</p>

<pre><code>Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.FileName = "tool.exe";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();

Console.WriteLine(output);
Console.ReadLine();
</code></pre>

<p>Then nothing gets outputted, i.e. my variable "output" is always empty.</p>

<p>I've verified that tool.exe indeed outputs to standard output (and not standard error).</p>

<p>Anyone have a clue of what's going on? Starting to feel stupid here, as it seems to be a real text book example...</p>
