Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I suppress the Microsoft Error Report dialog when a child process crashes

Tags:

c#

.net

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();
like image 330
Robert Davis Avatar asked Aug 11 '10 18:08

Robert Davis


People also ask

How do I turn off Windows Error Reporting?

Press the Win key and click on the Control Panel option in the Start Menu to launch it. Navigate to System and Security > Action Center > Problem Reporting Settings. Select the Never check for solutions option and click on the OK button.

What are the four problem reporting settings that allow you to specify how you want Microsoft to check for solutions?

1 - Always ask (default) 2 - Parameters only. 3 - Parameters and safe data. 4 - All data.

Can I end Windows problem reporting?

Select System under the or pick a Control Panel icon section. Select the Advanced tab. Select Error Reporting near the bottom of the window. Choose Disable error reporting.

What does Windows Error Reporting Service do?

Windows Error Reporting (WER) is a flexible event-based feedback infrastructure designed to gather information about the hardware and software problems that Windows can detect, report the information to Microsoft, and provide users with any available solutions.


1 Answers

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.

like image 68
Shoban Avatar answered Oct 11 '22 23:10

Shoban