Developer, Former MVP, now at Microsoft - Best of 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
Application.Run
AppDomain.UnhandledException
Application.ThreadException
try..catch
static class EntryPoint { [MTAThread] static void Main() { // Add Global Exception Handler AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OnUnhandledException); Application.Run(new Form1()); } // In CF case only, ALL unhandled exceptions come here private static void OnUnhandledException(Object sender, UnhandledExceptionEventArgs e) { Exception ex = e.ExceptionObject as Exception; if (ex != null) { // Can't imagine e.IsTerminating ever being false // or e.ExceptionObject not being an Exception SomeClass.SomeStaticHandlingMethod(ex, e.IsTerminating); } }}
e.IsTerminating
false