Files
CodeSnippets/ErrorHandling.cs

9 lines
426 B
C#

// 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);
}