private void ThisAddIn_Startup(object sender, EventArgs e) { var rootDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); var workingDirectory = Path.Combine(rootDirectory, "enovating", "patent-office-tools"); try { ToolsContext.Initialize(workingDirectory); } catch (UserSettingsException) { ToolsContext.Reset(workingDirectory); ToolsContext.Initialize(workingDirectory); } catch (Exception exception) { MessageBox.Show("Fatal error during module initialization: " + exception.Message, "Patent Office Tools"); } }