ResGen.exe stucks when redirect output
- by Darqer
Hello
I try to redirect standard output from ResGen.exe. I use following code
ProcessStartInfo psi = new ProcessStartInfo( "resxGen.exe" );
psi.CreateNoWindow = true;
psi.Arguments = sb.ToString();
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
Process p = Process.Start( psi );
p.WaitForExit();
StreamReader sr = p.StandardOutput;
string message = p.StandardOutput.ReadToEnd();
It stuck on p.WaitForExit. When I turn off output stream redirection and do not read StandardOutput it works correctly.
What do I do wrong ?