Vas Giatilis
Vas Giatilis

Reputation: 1098

Outlook Add In crash report

If there is a crash of an Outlook Add In and the exception is unhandled, is there a way to obtain crash log data for that particular Add In?

Upvotes: 0

Views: 1432

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49455

Nope. I'd suggest handling exceptions in the code. Also I'd recommend creating a log file for each add-in run and write all operations there. It will help you to diagnose the issue.

You can check this source for more info on VSTO logging and alerts, but in essence you change two environment variable values depending on what you need to do:

Displaying VSTO Alert Prompts

To display each error in a message box, set the VSTO_SUPPRESSDISPLAYALERTS variable to 0 (zero). You can suppress the messages by setting the variable to 1 (one).

Logging VSTO Alerts to a Log file

To write the errors to a log file, set the VSTO_LOGALERTS variable to 1 (one).

Visual Studio Tools for Office creates the log file in the folder that contains the application manifest. The default name is .manifest.log. To stop logging errors, set the variable to 0 (zero).

Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.

Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.

Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.

When you re-enable a soft-disabled add-in, the application immediately attempts to load the add-in. If the problem that initially caused the application to soft disable the add-in has not been fixed, the application will soft disable the add-in again.

Upvotes: 4

Related Questions