Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Do you need multiple solutions to create side-by-side VSPackages for multiple versions of Visual Studio?

$
0
0

I'm creating a Visual Studio extension (via VSPackage) and would like it to be available for both VS 2012 and 2013.  I first created the 2012 extension in VS 2012, and then upgraded my project so it could be opened in VS 2013, and added my 2013 project; so now I have both projects, VSPackage2012 and VSPackage2013, in a Visual Studio 2013 solution.

When I set VSPackage2012 as the startup project, my extension does not get loaded into the VS 2012 Experimental instance at all.  When I set VSPackage2013 as the startup project, I see that my package constructor gets called twice, and the Debug Output shows that it is loading symbols for both VSPackage2012.dll and VSPackage2013.dll.  This later results in a CompositionContractMismatchException being thrown when trying to load the extensions settings; I'm pretty sure it is trying to cast a class type from the VSPackage2012 to the equivalent class type in VSPackage2013.  I can also see that both my extensions get added to "C:\Users\[Username]\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\12.0Exp\Extensions\DansKingdom", but none get added to "11.0Exp", so it's clear that it is loaded both extensions in 2013, but neither in 2012.  The packages' VSIX manifest files specify that they are only available to be installed on their appropriate VS version.

Ideally I would like to just use a single VSPackage to publish my extension to both VS 2012 and 2013, but I'm making use of the Team Foundation assemblies and I believe they require linking to the specific version of the assemblies i.e. 2012 (v11.0) or 2013 (v12.0).

So is there a way that I can have multiple VSPackages targeted at different versions of Visual Studio in the same solution.  I have extracted all of the shared code out into another project (about 95% of the code), so I would like to have all 3 projects in the same solution if possible, as it means faster development time and only having to build one solution to build all of the VSPackages, rather than constantly switching between solutions.  Or is this simply not supported?

I have read through this page and this one as well as several pages they link to, but they don't really answer my question of how to setup my side-by-side VSPackages in VS.  Any advice you can give is appreciated.  Thanks.


- Dan - "Can't never could do anything"




Viewing all articles
Browse latest Browse all 4410

Trending Articles