如何在 Windows Vista 上禁用“调试/关闭应用程序"对话框? [英] How do I disable the 'Debug / Close Application' dialog on Windows Vista?
问题描述
当应用程序在 Windows 上崩溃并且安装了 Visual Studio 等调试器时,会出现以下模式对话框:
When an application crashes on Windows and a debugger such as Visual Studio is installed the following modal dialog appears:
[标题:Microsoft Windows]
[Title: Microsoft Windows]
X 已停止工作
一个问题导致程序停止工作正常.窗户将关闭程序并通知您解决方案可用.
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
[调试][关闭应用程序]
[Debug][Close Application]
有没有办法禁用这个对话框?也就是说,程序是否只是崩溃并默默燃烧?
Is there a way to disable this dialog? That is, have the program just crash and burn silently?
我的情况是我想运行几个自动化测试,其中一些会由于被测应用程序中的错误而崩溃.我不希望这些对话框拖延自动化运行.
My scenario is that I would like to run several automated tests, some of which will crash due to bugs in the application under test. I don't want these dialogs stalling the automation run.
四处搜索,我想我已经找到了在 Windows XP 上禁用此功能的解决方案,该解决方案正在使用此注册表项:
Searching around I think I've located the solution for disabling this on Windows XP, which is nuking this reg key:
HKLMSoftwareMicrosoftWindows NTCurrentVersionAeDebugDebugger
HKLMSoftwareMicrosoftWindows NTCurrentVersionAeDebugDebugger
但是,这不适用于 Windows Vista.
However, that did not work on Windows Vista.
推荐答案
要强制 Windows 错误报告 (WER) 进行故障转储并关闭应用程序,而不是提示您调试程序,您可以设置这些注册表项:
To force Windows Error Reporting (WER) to take a crash dump and close the app, instead of prompting you to debug the program, you can set these registry entries:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsWindows Error Reporting]
"ForceQueue"=dword:00000001
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsWindows Error ReportingConsent]
"DefaultConsent"=dword:00000001
设置后,当您的应用程序崩溃时,您应该在以下位置看到 *.hdmp 和 *.mdmp 文件:
After this is set, when your apps crash, you should see *.hdmp and *.mdmp files in:
%ALLUSERSPROFILE%MicrosoftWindowsWER
这篇关于如何在 Windows Vista 上禁用“调试/关闭应用程序"对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!