Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
728 views
in Technique[技术] by (71.8m points)

testing - How do I disable the 'Debug / Close Application' dialog on Windows Vista?

When an application crashes on Windows and a debugger such as Visual Studio is installed the following modal dialog appears:

[Title: Microsoft Windows]

X has stopped working

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.

Searching around I think I've located the solution for disabling this on Windows XP, which is nuking this reg key:

HKLMSoftwareMicrosoftWindows NTCurrentVersionAeDebugDebugger

However, that did not work on Windows Vista.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

After this is set, when your apps crash, you should see *.hdmp and *.mdmp files in:

%ALLUSERSPROFILE%MicrosoftWindowsWER

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...