Call to GNUmake via System.Diagnostics.Process results in error only if redirecting output

  • Thread starter Thread starter rubikzube*
  • Start date Start date
R

rubikzube*

I am attempting to place a call to make via System.Diagnostics.Process
using the sample code below. If I comment out the two problem lines
indicated, then the code runs smoothly and make performs quite well.
If I leave the two problem lines in, then make "encounters a problem"
at the exception line indicated, and pops up a dialog box for sending
the error report to microsoft.

The technical information in the error report itself is undecipherable
in its native format and cannot be copied and pasted as far as I can
gather... I have however, included a truncated copy of the event
information below. While I do not have the inclination to debug a
Visual Studio disassembled make, I was wondering if anyone had any
thoughts on why redirecting standard output and error would have such a
drastic effect.

CODE

StreamReader errorReader;
StreamReader buildReader;

buildProcess = new Process();
buildProcess.StartInfo.FileName = makePath;
buildProcess.StartInfo.Arguments = makeArguments;
buildProcess.StartInfo.CreateNoWindow = true;
buildProcess.StartInfo.RedirectStandardOutput = true; // problem line
buildProcess.StartInfo.RedirectStandardError = true; // problem line
buildProcess.StartInfo.UseShellExecute = false;
buildProcess.Start(); // exception line

buildReader = buildProcess.StandardOutput;
errorReader = buildProcess.StandardError;
buildProcess.WaitForExit(millisecondsToWait);

ERROR

Event Type: Error
Event Source: Application Error
Event Category: None
Event ID: 1000
Description:
Faulting application make.exe, version 0.0.0.0, faulting module
make.exe, version 0.0.0.0, fault address 0x00012b64.
 
Also of note : I am using the.Net Framework v1.1.4322 and GNU Make
version 3.75, by Richard Stallman and Roland McGrath.
 
Back
Top