Diagnosing an exception using the error report RRS feed

  • Question

  • My VB .NET app sometimes causes an exception.  The target machine is far away so I can't put a debugger on it and debug it.  Plus the exception does not always occur.  I had the user send me the exception address from the error report (by clicking on "What data does this error report contain" and then "View the contents of the error report").  Is there any way to determine where in my code the exception is occurring from the error report information?  I can't find a compiler/link option to print out address information.


    Please don't tell me to add better exception handling.  That's obvious.  I want to know how to investigate the problem using the error report.




    Monday, September 10, 2007 3:39 PM


  • VFaul,


    Based on your post, you are able to retrieve the Error Report from the user computer, then you are engaged in the exception address from the error report.


    I would like to provide you the following suggestions on the issue:


    Please take a look at the Exception Assistant information. The Exception Assistant, which appears whenever a run-time exception occurs, shows the type of exception, troubleshooting tips, and corrective actions. The Exception Assistant can also be used to see the details of an exception object.


    Exception.InnerException Property can get the Exception instance that caused the current exception. When an exception X is thrown as a direct result of a previous exception Y, the InnerException property of X should contain a reference to Y. Use the InnerException property to obtain the set of exceptions that led to the current exception. You can create a new exception that catches an earlier exception. The code that handles the second exception can make use of the additional information from the earlier exception to handle the error more appropriately.


    Exception.StackTrace property gets a string representation of the frames on the call stack at the time the current exception was thrown.


    Please take a look at the following thread related to the Exception error report in Visual Studio and hope that can provide you some idea:


    .NET 2.0 Windows Error Reporting trouble


    If an exception goes unhandled in a .NET 2.0 application, it will use Windows Error Reporting to send a report automatically. On client operating systems, that will involve popping the dialog. On server OSes, it will queue a report for later approval by an administrator.


    The most common reason for an application to not be reporting problems is that there's an overzealous catch block somewhere that is preventing exceptions from going unhandled even when they should. (For example, a catch Exception block in the main function.)


    If your application is a Windows Forms application, WinForms has a catch handler in its event loop that pops up a dialog and prevents the automatic error reporting from kicking in. To disable that, call Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException) before your call to Application.Run.


    You can also post the question in Visual Studio Debugger forum for the further help on this kind of problems. If you have any further information, please feel free to reply.


    Thanks again for your question.

    Thursday, September 13, 2007 7:14 AM