Click here to Skip to main content
Click here to Skip to main content

How to Migrate VS Package from VS2008 to VS2010 Beta 2

, 29 Dec 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
The new model of creating and deploying VS extensions is now easier but the migration to this fine technology is not so sweet. Since this is a cutting edge technology, one can find very little resources on the Internet. One frustrating moment was when I realized that some things have changed even be

Introduction

Last few days I was making a migration of my VS package from VS2008 to VS2010 beta 2. The new model of creating and deploying VS extensions is now easier but the migration to this fine technology is not so sweet. Since this is a cutting edge technology, one can find very little resources on the Internet. One frustrating moment was when I realized that some things have changed even between beta 1 and beta 2 and tutorials for beta 1 are not valid anymore (For example: http://msdn.microsoft.com/en-us/library/cc512930(VS.100).aspx).

So, I had to learn some things on a hard way, and I will show you what I had to do to make it work.

Migration Steps

  1. Open your solution in VS2010 and let the conversion wizard do what he knows to do. This wizard will only make possible that your solution can be built in VS2010 but VS package stays in format needed for VS2008, so when you run it, it will raise VS2008 experimental hive where you can find it. This is, probably, not the thing you need, but maybe useful for someone who just wants to change development environment.
  2. Change project file (*.csproj) in some text editor (Some of these changes can be done in Solution explorer, like changing references…):
    • Change target framework version to v4.0
      <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    • Delete or comment out OldToolsVersion node
      <OldToolsVersion>3.5</OldToolsVersion>
    • Change reference of Microsoft.VisualStudio.Shell.9.0 to Microsoft.VisualStudio.Shell.10.0
      <Reference Include="Microsoft.VisualStudio.Shell.10.0" />
    • add a reference to Microsoft.VisualStudio.Shell.Immutable.10.0.dll
      <Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0.dll" />
    • add a reference to Microsoft.VisualStudio.Shell.Interop.10.0.dll
      <Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0.dll" />
    • Change the import node referring to the Microsoft.VsSDK.targets file to point at v10.0
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
    • Create XML file namedsource.extension.vsixmanifest, add it to your project, set build action to ‘None’ and change its properties. I think nodes are self descriptive so I won’t describe them in details.
      <?xml version="1.0" encoding="utf-8"?>
      <Vsix Version="1.0.0" xmlns="http:schemas.microsoft.com/developer/vsx-schema/2010">
        <Identifier Id="f1005182-2bd3-4593-8029-58415f522152">
          <Name>DemoMigration</Name>
         <Author>DemoCompany</Author>
        <Version>1.0</Version>
        <Description>Information about my package</Description>
        <Locale>1033</Locale>
        <InstalledByMsi>false</InstalledByMsi>
        <SupportedProducts>
          <VisualStudio Version="10.0">
            <Edition>Pro</Edition>
       	    <Edition>VST_All</Edition>
          </VisualStudio>
        </SupportedProducts>
        <SupportedFrameworkRuntimeEdition MinVersion="2.0" MaxVersion="4.0" />
      </Identifier>
      <References />
      <Content>
        <VsPackage>|MigrationDemoPackage;PkgdefProjectOutputGroup|</VsPackage>
      </Content>
      </Vsix>
    • image002.jpg
  3. Open solution, right-click your project, go to properties and change “Start external program” value in Debug tab to point at VS2010 devenv.exe.
  4. image003.jpg
  5. Now, you can start your package in VS2010
  6. image004.jpg

Deployment Changes

In VS2010 introduces new concepts of deployment. There is a concept of a VSIX package which simplifies deployment because it doesn’t need PLK or registry entries for registering package. All relevant files are now in .vsix file (vsixmanifest and pkgdef). Detailed info about deployment can be found at MSDN: http://msdn.microsoft.com/en-us/library/dd393694(VS.100).aspx

Conclusion

Visual Studio 2010 comes with improved and easier extensibility but migration from VS2008 is not yet documented very well, so I hope this article will help developers to make smooth migration to this new technology and take benefits from it.

History

First version 29.12.2009

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

GoranZoran
Software Developer (Senior) Asseco South Eastern Europe
Serbia Serbia
5 years of experience in software development with many technologies such as Visual Studio Extensibility, ADO.NET Entity Framework, Astoria, LINQ, Reflection, WCF...

Comments and Discussions

 
GeneralAttribute showing as Obsolete PinmemberJohn Radley3-Feb-10 1:08 
GeneralRe: Attribute showing as Obsolete PinmemberGoranZoran3-Feb-10 11:26 
GeneralExtra Step needed PinmemberJohn Radley3-Feb-10 0:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150327.1 | Last Updated 29 Dec 2009
Article Copyright 2009 by GoranZoran
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid