//I can't make this part of the static constructor because the SetUnhandledExceptionMode needs to be called at a controlled point in the code. //It will throw an error if a control is already initialized on the thread that calls this. public void InitializeExceptionHandling() { //DlsTraceListener.Start(); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); System.Windows.Forms.Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); System.Windows.Forms.Application.SetUnhandledExceptionMode(System.Windows.Forms.UnhandledExceptionMode.Automatic); _eventLogWriter.WriteInfo("Started"); }