That's good for user, not for developper, because he needs to handle unhandled exceptions with debugger, cuz it's much more informative.
So, we need to lock bug reporting when application is under debugger.
Here's the solution:
if (!Debugger.IsAttached)
{
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler
(CurrentDomain_UnhandledException);
Application.ThreadException +=
new System.Threading.ThreadExceptionEventHandler
(Application_ThreadException);
}
P.S. To use the Debugger class you need using System.Diagnostics namespace
Комментариев нет:
Отправить комментарий