none
WER Dialog not showing up on Vista

    Question

  • What should a managed application do in order to have the WER Submit report dialog appear?

     

    We have a managed client application that is subscribing the App domain's UnhandledException event.  When this occurs, we log the exception, stack trace, and inner exception to the Application event log.  We would like to report this event to WinQual.  However, we are not seeing the WER dialog appear.  Do we need to rethrow the exception in order for the WER dialog to appear?

     

    According to msdn documentation,

    "The system automatically reports unhandled exceptions; therefore, it is best for applications not to handle these exceptions. By default the report includes minidump and heap dump information. If the faulting process is interactive and has a top-level window, WER displays a user interface."

     

    However, I am not seeing this interface displayed.

     

     

    Secondly, if we wanted to send Microsoft more detail, like the contents we log to the event log, would we need to implement the WerReportCreate and WerReportSubmit.  Would the additional information be attached by the WerReportAddFile?

     

    Thx

    • Moved by Max Wang_Chinasoft Tuesday, April 26, 2011 5:27 PM forum consolidation (From:Windows Error Reporting for ISVs)
    Saturday, September 29, 2007 12:43 AM

Answers

  • Hi Jerry,

     

    Managed crashes are handled by the CLR (CLR2.0 reports are exposed through Winqual).  If your managed application is running on Windows Vista, then the CLR hands off the crash to WER so that the Operating System's opt-in model can be followed as well as any OS specific reporting policies.

     

    You don't need to do anything special in your application to get this to work, but I recall hearing about a special case with WinForm applications. Is this a WinForm App?

     

    For your second question ...If you want to take advantage of the Vista WER APIs for additional data collection, you need to use PInvoke.  You do not need to use WerReportCreate or WerSubmitReport. The additional information will automatically be submitted with the crash report.

     

    Thanks,

    -Jason

     

     

    Saturday, September 29, 2007 11:56 PM
  • Jerry,

     

    as far as I know, you'll get the "Debug" option only if a debugger has been installed on your system which is registered as your system's JIT (just-in-time) debugger.

     

    On Vista, all crashes are reported to Microsoft by default. Not all of them, however, are recorded and processed by Microsoft's Watson servers. For full Watson/Winqual support, you need to register and map your application. If you already have access to the Winqual server, check out the online help information there for details, or just check out some of the earlier discussions in this forum.

     

    Once you've registered and mapped your app, you can view incoming crash reports in the Winqual portal.

     

    Hope this helps,

     

      Claus

     

    http://www.clausbrod.de/Blog

     

    Monday, October 01, 2007 8:08 PM

All replies

  • Jerry,

     

    as you say, the MSDN docs say that "the system automatically reports unhandled exceptions". However, if I understand you correctly, you have written your own UnhandledException handler, and that turns those unhandled exceptions, well, into handled exceptions!

     

    If you want the WER automatisms to kick in, you could re-throw, as you suggested. Alternatively, if you want to take complete control over the reporting process, you may want to follow the recipe which I outlined in my blog a while ago - see http://www.clausbrod.de/Blog/DefinePrivatePublic20070625. This is an unmanaged code example, but I guess with some amount of P/Invoking you may be able to implement something similar in managed code.

     

    As yet another alternative, you could simply let the app crash, without ever registering your own UnhandledException code. This will also create entries in the application log, and you'll get the WER dialog automatically.

     

    Hope this helps,

     

      Claus

     

    http://www.clausbrod.de/Blog

     

     

    Saturday, September 29, 2007 8:37 AM
  • Jerry,

     

    alright, I did some more homework, and came to realize that the UnhandledException handler isn't actually a handler, but rather just a notification/event. Sorry for my misinterpretation, please ignore that part of my reply.

     

    I just wrote a simple console app (C#, .NET 2.0) which registers an UnhandledException handler and then provokes a crash. My UnhandledException handler is called, and afterwards the app crashes, displaying the usual WER dialog. This was on XP, though.

     

    On Vista, the reporting defaults are different from XP. On Vista, the default error reporting strategy is to always report to Microsoft, so the user isn't even asked whether or not to send a report. You may want to play with the settings in the "Problem Reports and Solutions" control panel.

     

    Which version of the .NET framework are you using? (.NET 1.1 had a different strategy for unhandled exceptions than 2.0.)

     

    Also, there is a registry entry which can be used to modify the CLR's exception handling strategy, see http://blogs.msdn.com/shawnfa/archive/2004/07/15/184490.aspx.

     

    Hope this helps,

     

      Claus

     

    http://www.clausbrod.de/Blog

     

     

     

    Saturday, September 29, 2007 2:08 PM
  • Hi Jerry,

     

    Managed crashes are handled by the CLR (CLR2.0 reports are exposed through Winqual).  If your managed application is running on Windows Vista, then the CLR hands off the crash to WER so that the Operating System's opt-in model can be followed as well as any OS specific reporting policies.

     

    You don't need to do anything special in your application to get this to work, but I recall hearing about a special case with WinForm applications. Is this a WinForm App?

     

    For your second question ...If you want to take advantage of the Vista WER APIs for additional data collection, you need to use PInvoke.  You do not need to use WerReportCreate or WerSubmitReport. The additional information will automatically be submitted with the crash report.

     

    Thanks,

    -Jason

     

     

    Saturday, September 29, 2007 11:56 PM
  • This is a WPF appliction.

     

     

     

    Monday, October 01, 2007 3:48 PM
  • Are you saying that I do NOT need to rethrow the exception?

     

     

    Monday, October 01, 2007 3:49 PM
  • I have also confirmed that on a WPF app, handling the AppDomain.UnhandledException event in my WPF app still enables the app to crash on Vista and for the WER dialog to appear (as long as you are running outside of VS).

     

    I have played with the "Problem Reports and Solutions" settings on Vista.  My Problem reporting is on and I allow each user to choose settings. When a error occurrs, I see a dialog that says it is checking for a solution.  When a solution is not found, I get another dialog that tells me that my app "JerryNoll_Watson" is has stopped working .  I am then given two options, to debug or close program.

     

    So here are my questions:

    1. Are users always offered the option to debug?  Seems strange to me.
    2. Are all applications reported back to Microsoft?  If so, how can I see mine?

    About the last question:  I do have access to Winqual and to Watson.  When I query these sites using my executable name, I get no hits.  Does this mean I did not send data to Microsoft or that I did not configure winqual correctly?

     

    Monday, October 01, 2007 7:59 PM
  • Jerry,

     

    as far as I know, you'll get the "Debug" option only if a debugger has been installed on your system which is registered as your system's JIT (just-in-time) debugger.

     

    On Vista, all crashes are reported to Microsoft by default. Not all of them, however, are recorded and processed by Microsoft's Watson servers. For full Watson/Winqual support, you need to register and map your application. If you already have access to the Winqual server, check out the online help information there for details, or just check out some of the earlier discussions in this forum.

     

    Once you've registered and mapped your app, you can view incoming crash reports in the Winqual portal.

     

    Hope this helps,

     

      Claus

     

    http://www.clausbrod.de/Blog

     

    Monday, October 01, 2007 8:08 PM