Syringe.Net.Nz
Irregular Injection of Opinion
RSS 2.0|Atom 1.0|CDF

 Monday, November 13, 2006
Windows Error Reporting from .NET Applications

I taught some classes recently for Vista app compat readiness.

One of the key things you need to ensure your app does for Vista is take advantage of Windows Error Reporting.

This means you MUST NOT just swallow all exceptions with your own exception handling.

A couple of quick tips around this.

1. If you want to rethrow an exception with the original stack trace do a blind throw like this

try

{
...
}
catch (Exception ex)
{
DoFoo();
throw;
}

Note that we don'te append the exception variable onto the throw.

You can avoid any .NET dialog boxes and throw unhandled exceptions straight to WER by using this line of code.

Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);

.NET | Vista|Monday, November 13, 2006 7:37:32 PM UTC|Comments [0]|    

All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, b, em, i, strike, strong, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview