KnowDotNet Visual Organizer

Migrating an Add-in from VS 2001 to VS 2003

The Process is not Automatic and There are Nuances

by Les Smith
Print this Article Discuss in Forums

Add-ins can be migrated form Visual Studio NET 2001 to the 2003 release, but the process of getting the add-in to run is not automatic and there are some nitty-gritty details of which you must be aware.

In the first place, an add-in built by the 2001 Add-in Wizard will operate with the 2003 release of Visual Studio .NET.  However, you will have to run a registry update by running a .REG file, such as the one shown below.  
The reason for this is that the Add-in Manager is looking for add-ins in version 1.0 under the registry key of

HKEY_LOCALMACHINE\SOFTWARE\Microsoft\Visual Studio\7.0\Addins

In version 1.1, the "7.0" has been changed to "7.1". Therefore, the only change you should have to make to get your existing add-ins to work, without migration, is to create a .REG file which will make a new copy of your add-ins description keys and place it under the new key as described above. The add-in DLL will execute without being rebuilt; it's just that the new Add-in manager is looking for it in a different place.

The contents of a .REG file to set up the data needed by the Add-in Manager might look like the following:

REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Addins]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Addins\NetCommander.Connect]
"FriendlyName"="NetCommander"
"Description"="Visual Studio .NET IDE Enhancer"
"LoadBehavior"="dword:00000003
"CommandLineSave"=dword:00000000

Because add-ins built under 2001 release will operate with no changes, unless you just have some time on your hands, there appears to be no real impetus to migrate an add-in to the new release.  To my knowledge, there were no noticable changes in the Extensibility Model from the first release to the second.  Therefore, it is not clear that there is anything to be gained from migration.  I can tell you that an add-in that is created under 2003 or migrated to 2003, will not connect to the 2001 IDE.   If you attempt to connect an add-in created under .NET 2003, or migrated to .NET 2003, you will receive the error shown in Figure 1.

Figure 1 - Error Trying to Connect an Add-in from 2003 to the 2001 IDE.  

Figure 1


This seems to make sense that you cannot connect a newer add-in to an older IDE because the add-in DLL becomes an extension of the IDE.

If you do choose to migrate your add-in to .NET 2003, you must manually setup the add-ins registry entry by using a .REG file similiar to the one described above.  Even if you create a setup project, build it, and install the migrated add-in, the registry entry of the Add-in Manager will not be entered into the "7.1/Addins" area of the registry.  Once you create and run (double-click on) the .REG file, the Add-in Manager in .NET 1.1 will see and load the add-in.

To see how to set up a deployment project so that the add-in will be ready for connection to both IDEs automatically, see my article on Add-in Registry Deployment.

Writing Add-Ins for Visual Studio .NET
Writing Add-ins for Visual Studio .NET
by Les Smith
Apress Publishing