/// <summary> /// Use this method for better performance results in pure Windows forms application /// Call this to register the exception trapper. /// This function should be the first function called in your application, it MUST be called before any forms are /// created. /// Good practice is to call it before Application.Run(). /// </summary> public static void RegisterWinFormsApplication(bool tryContinueAfterException = true, bool showExitAppWindow = true) { _tryContinueAfterException = tryContinueAfterException; _showExitAppWindow = showExitAppWindow; //get the registered form type. _form = new ReportForm(); _form.RegisterWindowsFormsExceptionEvents(OnException); ApplicationName = "AzureDevOpsTools.TestApp"; }