Event logging for Office solutions
Applies to: Visual Studio Visual Studio for Mac
Note
This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
You can use the event viewer in Windows to see exception messages that are captured by the Visual Studio Tools for Office runtime when you install or uninstall Office solutions. You can use these messages from the event logger to resolve installation and deployment problems.
Applies to: The information in this topic applies to document-level projects and VSTO Add-in projects. See Features available by Office application and project type.
Read the Event Log
Open Event Viewer and filter for the events you want to see.
To read the Event Log in Windows Server 2003 and Windows XP
In Control Panel, open Administrative Tools.
Start Event Viewer.
In the list of event logs, select Application.
On the View menu, click Filter.
In the Event source list, select VSTO 4.0.
For installation events, in the Event ID box, type 4096.
Click OK to see the filtered view.
To read the Event Log in Windows 7, Windows Vista, and Windows Server 2008
In Control Panel, open Administrative Tools.
Start Event Viewer.
Expand Windows Logs.
In the list of event logs, select Application.
On the Action menu, click Filter Current Log.
In the Event source list, select VSTO 4.0.
For installation events, in the Event ID box, type 4096.
Click OK to see the filtered view.
The event viewer includes the following information:
The location of the deployment manifest for the solution.
A message that describes the cause of the error or exception.
These exception messages can help you determine the reason for an installation problem, such as an untrusted certificate, an untrusted document location, or an invalid deployment manifest.
After an Office solution is uninstalled, the exception messages remain in the event log.
To show or log exception messages when an Office solution is running, see Debug Office projects and Debug Office projects.
Localization
The language of the exception message is determined by the Visual Studio Tools for Office runtime language. For instance, if the end-user computer has the Japanese language pack installed, the exception message is written to the event log in Japanese.
Disable the event logger
By default, the event logger is enabled when you install or uninstall Office solutions. You can disable the event logger by setting the VSTO_EVENTLOGDISABLED environment variable to "1" (one).
To disable the Event Log
In Control Panel, open System.
On the Advanced tab, click Environment Variables.
In the System variables pane, click New.
In the New System Variable dialog box, type VSTO_EVENTLOGDISABLED in the Variable name box.
In the Variable value box, type 1.
Click OK.