33.4. Debugging Office Applications
You can debug Office applications by using much the same process as you would with any other Windows application. All the standard Visual Studio debugger features, such as the ability to insert breakpoints and watch variables, are available when debugging Office applications.
The VSTO runtime, which is responsible for loading add-ins into their host applications, can display any errors that occur during startup in a message box, or write them to a log file. By default these options are disabled, and they can be enabled through environment variables.
To display any errors in a message box, create an environment variable called VSTO_SUPPRESSDISPLAYALERTS and assign it a value of 0. Setting this environment variable to 1, or deleting it altogether, will prevent the errors from being displayed.
To write the errors to a log file, create an environment variable called VSTO_LOGALERTS and assign it a value of 1. The VSTO runtime will create a log file called <manifestname>.manifest.log in the same folder as the application manifest. Setting the environment variable to 0, or deleting it altogether, will stop errors from being logged.
33.4.1. Unregistering an Add-In
When an application-level add-in is compiled in Visual Studio 2008, it will automatically register the add-in to the host application. Visual Studio will not automatically unregister the add-in from your application unless you run Build Clean Solution. Therefore, you may find your add-in ...