共用方式為


Enabling Add-ins in your Isolated VS Shell

There are two things that are verified when your VS Shell validates if an add-in can be loaded or not.  The first one is the name of the Shell application and the second one is the version of this application.  Usually, the name of the application is “Microsoft Visual Studio”.  With the Isolated VS Shell, you can customize this value through the  “AppData” entry from your .pkgdef file.  You will need to have this value as the <Name> property of the application in your .addin file. 

clip_image002

Then, there is the version of the application which usually matches the version of Visual Studio (i.e. “9.0”).  When using a VS Shell, this is actually extracted from the file version of your VS Shell executable.  To set this value, you need to add a “VERSION” resource through the resource view in your VS Shell project. 

clip_image004

Within this resource item, you will find the FILEINFO item with a default value of 1, 0, 0, 1.  This is the value that the add-in loader validates against the <Version> property in your .addin file.

clip_image006

There are several folders that your VS Shell will look for Add-ins.  These are defined in the registry under your Isolated shell hive […\Microsoft\AppEnv\9.0\Apps\<YourShell>\AutomationOptions\LookInFolders].  In order to have your VS Shell load your add-in, you need to copy your add-in binary along with the .addin file in one of those folders.

Once this is completed, you will need to update your .addin files.  These files need to have a <HostApplication> element that matches the information of your VS Shell.  Here is an example:

                <HostApplication>

                                <Name>VSShellStub2</Name>

                                <Version>1.0</Version>

                </HostApplication>

The <Name> property is equivalent to the value of the “AppData” property in your .pkgdef file.  The <Version> property matches the value you have for the FILEINFO resource that you added to your VS Shell project.  Once this information is added, the add-ins should be loaded and they should show up in the “Add-in Manager”.

 

Carl

Comments

  • Anonymous
    August 08, 2008
    PingBack from http://hoursfunnywallpaper.cn/?p=369

  • Anonymous
    August 11, 2008
    My latest in a series of the weekly, or more often, summary of interesting links I come across related to Visual Studio. Via DotNetKicks : Customizing WCF Proxy Generation in Visual Studio 2008 . Deparallelizer 1.0 is a utility to to make build logs more

  • Anonymous
    August 11, 2008
    VSX (Visual studio extensibility) team has a new post on how to enable visual studio addin&#39;s in Isolated