Finding the Visual Studio Activity Log

Sometimes when something goes wrong in Visual Studio, you might see the following dialog:

Visual Studio has encountered an exception...

We’ve had a number of users comment that the couldn’t find the file.  This is because the file is only written when you run Visual Studio’s executable (devenv.exe) with the /log parameter.  If you are reporting an issue to us (especially through the Connect site), the contents of the log file are very useful.  If you’re developing a custom extension to Visual Studio, this can also be useful for determining when and why something doesn’t work.

There are two easy ways to run Visual Studio with the /log parameter.  First, from the command line:

Run devenv from the command line

And second by editing the shortcut you use to run it:

add /log to an existing shortcut

Comments (2)

  1. Rich Ward says:

    Thanks for this.  The article certainly helped me resolve the issue of starting VS 2010 from DOS with the /log flag.  Unfortunately, no ActivityLog.xml file was generated.

    Interestingly, I again received an error dialog box with the following message:

    "You can get more information by running the application together with the /log parameter on the command line, and then examing the file 'C:Documents and SettingsrwardApplication DataMicrosoftVisualStudio10.0ActivityLog.xml".

    However, I have no Application Data directory under rward.

    Typically, if I try again Visual Studio crashes.

  2. Jimmy Lewis says:

    @Rich: How are you navigating to the folder?  It's usually hidden in Explorer, but you can either type it into the address bar, or navigate through it via the command line.  You can also use the %appdata% variable from the Explorer window, command line, or Start -> Run dialog.