【问题标题】:How do I suppress the Microsoft Error Report dialog when a child process crashes子进程崩溃时如何抑制 Microsoft 错误报告对话框
【发布时间】:2010-08-12 03:40:00
【问题描述】:

我正在使用System.Diagnostics.Process 对象创建一个进程,该对象有时会严重崩溃,Windows 会弹出“发送错误报告”对话框。我无法控制子进程,但我已经在处理崩溃的情况,如何防止弹出对话框?

  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();

【问题讨论】:

    标签: c# .net


    【解决方案1】:

    我认为实现这一点并不难。报告错误是用户的选择(我们通过控制面板 -> 操作中心 -> 问题报告设置(Win 7)进行设置)

    还有。查看this article from MS Support,它谈到了使用一些注册表项禁用此报告(适用于所有应用程序)。

    【讨论】:

    • 这很不幸,但值得一问。
    • WER Settings 还列出了一些注册表项,尤其是DontShowUI
    猜你喜欢
    • 2012-03-31
    • 2011-02-02
    • 2010-10-17
    • 2012-07-18
    • 2021-10-14
    • 2015-10-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多