Disable error reporting

  • Thread starter Thread starter Lucvdv
  • Start date Start date
L

Lucvdv

At http://support.microsoft.com/kb/325075/en-us it is explained how error
reporting can be disabled for Office.

Can this also be done for the .Net framework?

Or even better, can the errors for which a report is generated be filtered
(some ignored, some added) and can the reports then be redirected to a
custom reporting site?
 
Yes. You can control how your application acts when an unhandled exception
is thrown. I believe that you should look into System.AppDomain's
UnhandledException event, and System.Windows.Forms.Application's
OnThreadException virtual method and ThreadException event. I believe the
ThreadException event is the best bet, but I could be wrong. By plugging
into one or more of these, you can control how your application acts when an
unhandled exception is thrown.

If you want to set up your own error handling web service rather than using
MS' Quality website, you can check out MS' Shareware Starter Kit at
msdn.microsoft.com/vstudio/downloads/starterkits . It includes the ability
to set up your own web server that accepts reports from your program. Pretty
slick.

Just keep in mind that if you're developing a reusable library you shouldn't
be worrying about exception handling. Just document what exceptions might be
thrown and let the callers handle them.

If you're developing an application, let the program crash. An unhandled
exception is unhandled because you didn't know it would happen. If you don't
know it was going to happen, you couldn't have determined what to do when it
does occur. That's a bug. Let it crash, gather the crash report data, and
fix the bug. Don't just swallow the exception and hope that you can continue
without corrupting data or causing more problems.
 
Back
Top