Targeting multiple Visual Studio versions with the same binary package assembly

I am these days porting my MZ-Tools add-in to a package, and as every other developer of extensions I would like to target several different Visual Studio versions (say 2010, 2012 and 2013 and “14”) with:

  1. The same project file (MyAssembly.csproj)
  2. The same binary assembly (MyAssembly.dll)
  3. The same setup (MyAssembly.vsix or MyAssemblySetup.exe)

About #1, you need to learn something about MSBuild but is doable. In my case I just want to use VS 2013 always and changing something in the .csproj file I can deploy and debug selectively to VS 2010, 2012 or 2013 experimental instances. But if you want to change nothing, you can open the same .csproj file in different VS versions and deploy and debug for that VS version as Daniel Cazzulino explained in his post How to create a Visual Studio extensibility project that is compatible with VS 2010, 2012 and 2013. Jared Parsons has also explained about Round Tripping a VSIX project.

About #2, if you stick to the assemblies provided by VS 2010 that are also supplied by higher VS versions it is doable too. I have used that approach for MZ-Tools being an add-in for years, as I explained in the article HOWTO: Create an add-in that targets several Visual Studio versions with the same add-in DLL using C# or VB.NET.

About #3, .vsix files already have support for several Visual Studio versions specified in the manifest. And if you create your own setup (MSI or otherwise) you have full control of the deployment.

Email this to someoneTweet about this on TwitterShare on LinkedInShare on FacebookShare on Google+

2 thoughts on “Targeting multiple Visual Studio versions with the same binary package assembly”

  1. re: #3 vsix: VS14 supports vsix format version 1 but the following version of VS will likely drop support for version 1 (which is the only version that is supported by VS2010). Version 2 is utterly incompatible with version 1.

Leave a Reply

Your email address will not be published. Required fields are marked *