How to enable the Window Error Reporting (WER) dialog. Total newbie question
After setting up WinQual and WER for the first time, I intentionally inserted a crash in a release build expecting\hoping to get the WER dialogue but instead still get the dialogue containing "runtime error! The application has requested the runtime to terminate in an unusual way...".
Everything seems to be working correctly regarding the setup of WinQual (along with all the supporting symbol server, source server,WinQual account, submitted mapping files and verified their presence my WinQual account). Now I want to verify that dump files are created, su开发者_运维技巧bmitted to WinQual and I can retrieve them for debugging.
I verified that my PC's (XP Pro SP3) error reporting is enabled (system properties-error reporting). I figured the hard part would be setting up everything above not getting the program to actually show the WER dialogue. Is there some modification to the exe or the PC needed?
It's good to know I may not be (completely) crazy. You're right that external issues were causing problems for the WER dialogue.
I changed the crash to the code above, just in case my version was too brutal, and ran the application on three machines and it appears that the presence of Visual Studio and/or just-in-time debugging, on XP and Win7, was affecting the WER dialogue. For anyone interested this is what I saw:
- XP with Visual Studio. Asked to choose a debugger and if I chose No, the program exited without the WER dialogue.
- XP without Visual Studio. Displayed WER dialogue and sent the error report (yeah).
- Win7 with Visual Studio. Did not crash at all.
- Win7 without Visual Studio. I have not tested yet but suspect it will behave correctly.
So as you implied, a combination of the crashing code and unrepresentative testing environment were thwarting my test.
Thanks so much!
If you are using a WinForms application there is a catch handler in it's event loop that pops up a dialog and prevents Windows Error Reporting (WER) from kicking in.
This call prevents this from happening. (http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/176b7f8c-3efb-4e6f-8deb-c685c62629db/)
The magic line to fix:
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
There shouldn't be anything you need to do in the application to get it working. I suspect you've somehow managed to crash in some strange way that is not working too well with WER. Try adding a crash once the application has initialised, rather than during application startup (if that is what you're doing). I usually do something like this:
int* p=0;
*p=1;
Another possibility is that your machine isn't going to give you the same results as an end user because of the Just In Time debugger of Visual Studio, so try it on a typical end-user machine. A further possibility is that your machine is XP and WER support was at an early stage in XP and is better in Vista and Win7, so try crashing the app on a newer machine.
精彩评论