-3

Is it possible to disable all errors in C# winform application? I wan't to hide/disable that messages:

Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166
Dewagg
  • 145
  • 10

1 Answers1

0

See the AppDomain.UnhandledException event. Just assign a handler as the first bit of code in your application and you can do whatever you want with unhandled errors.

AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
{
   //handler code
};

However, see the first comment to your post...are you SURE you want to do that? You never know what kind of errors you might be swallowing at that point.

Steve Danner
  • 21,818
  • 7
  • 41
  • 51
  • 2
    Would probably be best to attach to Application.ThreadException as well, since it's WinForms. – Saragis Jul 06 '15 at 18:52