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.
- 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.
- 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
- Delete or comment out OldToolsVersion node
- Change reference of
<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 named
source.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.
<Vsix Version="1.0.0" xmlns="http:schemas.microsoft.com/developer/vsx-schema/2010">
<Description>Information about my package</Description>
<SupportedFrameworkRuntimeEdition MinVersion="2.0" MaxVersion="4.0" />
- Open solution, right-click your project, go to properties and change “Start external program” value in Debug tab to point at VS2010 devenv.exe.
- Now, you can start your package in VS2010
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
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.
First version 29.12.2009