المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : cant get standardoutput when calling devenv from System.Process



C# Programming
08-28-2009, 05:26 AM
I have a method that creates a new process and calls the command line. I can get standardoutput into the procResults strings for most of my calls. But for some reason when I use this method to call devenv to build a c# solution I don't get anything in standardoutput. It seems like it finishes the call because all new files are built and I can see the last modified date is the current time, but the procResults string is empty. Here is my call:
'devenv alphacetui.sln /rebuild "debug|x86"'

it seems like it finishes ok because I get a p.Exitcode = 0;
Does anyone have experience calling devenv from system.process or know why I'm not getting output?
when I run devenv alphacetui.sln /rebuild "debug|x86" from the command line it works fine and I can see the output in the command ********

public void method()
{
Process p = new Process();
p.StartInfo.FileName = "devenv";
p.StartInfo.Arguments = "alphacetui.sln /rebuild \"debug|x86\"";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
string procResults = p.StandardOutput.ReadToEnd();
p.WaitForExit();
}