The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

How To: Migrate VSPackages to Visual Studio 2008

Updated: July 2008

Because there are differences between Visual Studio 2005 SDK and Visual Studio 2008 SDK, some changes to existing VSPackages may be required so that they work correctly in Visual Studio 2008 SDK. The procedures in this topic show how to migrate VSPackages to Visual Studio 2008, and also how to continue to use Shell and Shell.Interop from Visual Studio 2005 SDK if your VSPackage requires them.

This procedure shows how to migrate a basic project package to Visual Studio 2008 whether or not the project uses ProjectAggregator2. We recommend that you use a computer that has both Visual Studio 2005 SDK and Visual Studio 2008 SDK installed when you perform the procedure.

To migrate a basic VSPackage to Visual Studio 2008

  1. Make a copy of the Visual Studio 2005 project file.

  2. Start Visual Studio 2008, and then open the package solution.

  3. Click Next,and then create a backup when you are prompted.

  4. Click Next, and then click Finish.

    If a message about failed conversion appears, ignore it.

  5. Unload the project file.

  6. Right-click the project file, and then click Edit <myVSPackage>.csproj.

  7. In the project file, comment out the following line.

    <Import Project="C:\Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioIntegration\Tools\Build\Microsoft.VsSDK.targets" />
  8. Add this line.:

    <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\VSSDK\Microsoft.VsSDK.targets" />
  9. Remove the reference to the target registry root by commenting out the following line.


    Visual Studio 2008 SDK automatically picks the correct registry root.

  10. To update the shell references to Shell 9.0, comment out the following line.

    <Reference Include="Microsoft.VisualStudio.Shell" />
  11. Add these two lines:

    <Reference Include="Microsoft.VisualStudio.Shell.9.0" /><Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" />

    This causes your project to create a .pkgdef file when the package is built. A .pkgdef file resembles the output of regpkg.exe in Visual Studio 2005 SDK.

  12. If the project uses ProjectAggregator2, update the Project Base sources by removing FlavoredProjectBase.cs from the project.

  13. Save the project file and close it.

  14. Right-click the project file and reload it.

  15. To update the Debugging properties of the project, right-click the project file, and then click Properties.

    On the Debug tab, enter devenv.exe from Visual Studio 9.0 in the Start external program property and add /RANU to the command-line arguments.

Now, pressing F5 should run the package in Visual Studio 2008.

If your project cannot be changed to use the Visual Studio 2008 Shell.9.0 and Shell.Interop.9.0, and must it keep references to Microsoft.VisualStudio.Shell from Visual Studio 2005 SDK, follow these steps.

To migrate a package that must keep Microsoft.VisualStudio.Shell

  1. Unload the project file.

  2. Right-click the project file, and then click Edit <myVSPackage>.csproj.

  3. In the PropertyGroup element near the end of the project file, set UseVS2005MPF to true, and set RegisterWithRanu to false.

  4. Save the project file and close it.

  5. Close Visual Studio 2008.

In this case, the version of regpkg.exe from Visual Studio 2005 SDK is used to register the package. That version of Visual Studio 2005 SDK did not support Run As Normal User (RANU), which requires Visual Studio 2008 to be run under Administrator credentials. To run as Administrator, you must create a hive under HKLM_Local_Machine for an experimental version of Visual Studio.

To run as Administrator

  1. To create the experimental hive in Windows Vista, open a Command Prompt window as Administrator, change to the directory where Visual Studio 2008 SDK is installed, and run the following command.

    vsregex getorig 9.0 Exp

  2. Restart Visual Studio 2008 as Administrator.

Now the package should build successfully, and an experimental instance of Visual Studio 2008 should open together with the new package.




July 2008

Topic added.

Customer feedback.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft