How do I handle a CTD from an external command line app in C#
<p>I have a third party command line app. I am running it via the code below:</p>

<pre><code>            var scannerPath = Path.Combine(scannerFolder, "BGLScan.exe");

            string commandLine = scannerPath + "  ";

            var compilerInfo = new ProcessStartInfo(commandLine) {
                Arguments = '\"' + checkFolder + '\"',
                UseShellExecute = false,
                CreateNoWindow = true,
                RedirectStandardOutput = true,
                RedirectStandardError = true
            };

            var proc = new Process {
                StartInfo = compilerInfo
            };
            proc.Start();

            StreamReader stdOutput = proc.StandardOutput;
            StreamReader stdError = proc.StandardError;
            string outputMessage = stdOutput.ReadToEnd();

            stdOutput.Close();
            stdError.Close();
            proc.Close();    
</code></pre>

<p>The external command line app is crashing and I am getting the Windows message that it has stopped working etc etc.   I can cancel this and my process seems to stop.  I see an error message in the stdError stream.  However I would like to be able to stop the Windows message from appearing and handle the problem inside my App.  I have checked the properties etc for ProcessStartInfo.  I looked at ErrorDialog but that seems to relate only to a situation where the process cannot start.  In my case the process starts and runs.  If I run the app from the command line using the same arguments I get the error reported and the command window closes.</p>

<p>I am sure I am missing something simple but it eludes me....</p>
