tags:

views:

55

answers:

1

I'm creating a process with the System.Diagnostics.Process object that sometimes crashes badly and Windows puts up the Send Error Report dialog. I have no control over the child process, but I'm already handling the case when it crashes, how do I prevent the dialog from poping up?

  Process p = new Process();
  p.StartInfo.FileName = Path.Combine(avokeHome, @"bin\folderstx.exe");
  p.StartInfo.Arguments = "-f" + propertiesFile;
  p.StartInfo.CreateNoWindow = true;
  p.StartInfo.UseShellExecute = false;
  p.StartInfo.RedirectStandardError = true;
  p.StartInfo.RedirectStandardOutput = true;
  p.OutputDataReceived += (sender, e) => { if(!string.IsNullOrEmpty(e.Data)) Console.WriteLine(e.Data); };
  p.ErrorDataReceived += (sender, e) => { if(!string.IsNullOrEmpty(e.Data)) Console.WriteLine(e.Data); };
  p.EnableRaisingEvents = true;
  p.Exited += (sender, e) => { Console.WriteLine("Exited"); };
  p.Start();
  p.BeginErrorReadLine();
  p.BeginOutputReadLine();
+2  A: 

I think its little difficult to achieve that. Reporting an error is user's choice (We set it via Control Panel -> Action Centre -> Problem Reporting Settings (Win 7))

Also. Check out this article from MS Support which talks about disabling this reporting (for all apps) with some registry entries.

Shoban
This is unfortunate, but it was worth asking.
Robert Davis
[WER Settings](http://msdn.microsoft.com/en-us/library/bb513638%28VS.85%29.aspx) also lists some registry keys, in particular the `DontShowUI`.
romkyns