How to: Write to the Activity Log (C#)
VSPackages can write messages to the activity log. This feature is especially useful for debugging VSPackages in retail environments.
To write an entry to the activity log
Insert this code in the Initialize method or in any other method except the VSPackage constructor:
In the Visual Studio Command Window, start devenv.exe with the /log switch. Make sure that you add the appropriate /rootsuffix argument to run in the registry root where the VSPackage is registered, for example: devenv /rootsuffix Exp /log.
Load the VSPackage.
To examine the activity log
Find the activity log.
By default, the location is <CURRENTUSERPROFILE>\Application Data\Microsoft\VisualStudio\8.0Exp\ActivityLog.XML.
Open the activity log with any text editor.
Following is a typical entry:
50 Entering initializer for: Company.MyPackage.MyPackage ...