MSDN states that it is possible in .NET to capture the output of a process and display it in the console window at the same time.
Normally when you set
you can easily catch all messages using
Process build = new Process();
...
build.StartInfo.UseShellExecute = false;
build.StartInfo.RedirectStandardOutput = true;
build.StartInfo.RedirectStandardError = true;
build.StartInfo.CreateNoWindow = true;
build.ErrorDataReceived += build_ErrorDataReceived;
build.OutputDataReceived += build_ErrorDataReceived;
build.EnableRaisingEvents = true;
...
and create the Event build_ErrorDataReceived
static void build_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
string msg = e.Data;
if (msg != null && msg.Length > 0)
{
// in msg you have the line you need!
}
}
I add a little example
Screencast of the application
Solution Files (VS 2008)