When installing add-ins for Visual Studio, a number of different paths can be used. One of them is C:\Documents and Settings\All Users\Application Data\Microsoft\MSEnvSharedAddins — in a default installation of a US English Windows. Obviously a proper installer would use Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) to make sure the path is correct for the current system and for the current language. For example, for a German system the result would be `C:\Doku …


I saw this question on a newsgroup: How do you access the properties of a project via the EnvDTE VS extensibility interface? It’s really quite simple, like in this code:

Sub AccessProject()
  Dim proj As Project
  proj = DTE.Solution.Projects.Item(1)
  Dim prop As [Property]
  For Each prop In proj.Properties
    Debug.Print("Project property " & prop.Name & " = " & prop.Value)
  Next
  Dim projItem As ProjectItem
  For Each projItem In proj.ProjectItems
    Debug.Print("Project item " & ...

In a VSPackage using the Managed Package Framework (MPF), how do you track the active editor pane in VS? To start with, I create a new VSPackage project (New project -> Other project types -> Extensibility -> Visual Studio Integration Package) and have the wizard create a C# based project with a tool window for me. From the standard button click (to keep things under control easily), I run the following initialization code:

DTE dte = (DTE) GetService(typeof(DTE));

Window outputWindo ...

VSIP 2005 has been available a while, but I hadn’t found the time to look into it. Now I did and I must say I’m impressed, especially by the new managed classes in the Environment SDK. For example, it’s now possible to create a custom editor for Visual Studio completely in C#, and creating a tool window in managed code is really a matter of a few lines. Great work, I’ll have to have a much closer look at this managed stuff!