diff --git a/ErrorHandling.cs b/ErrorHandling.cs new file mode 100644 index 0000000..9a60cc7 --- /dev/null +++ b/ErrorHandling.cs @@ -0,0 +1,9 @@ +// Catching All Errors in program.cs + +// if (!Debugger.IsAttached) { +// if (!AppDomain.CurrentDomain.FriendlyName.EndsWith("vshost.exe")) { +if (!Debugger.IsAttached) { + Application.ThreadException += new ThreadExceptionEventHandler(HandleCrashes); + Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); + AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(HandleCrashes); +} \ No newline at end of file