/// <summary> /// 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 Register(bool tryContinueAfterException = true, bool showExitAppWindow = true) { _tryContinueAfterException = tryContinueAfterException; _showExitAppWindow = showExitAppWindow; //get the registered form type. _form = new ReportForm(); _form.RegisterExceptionEvents(OnException); ApplicationName = "AzureDevOpsTools.TestApp"; }