Reputation: 19733
I wrote this extension when VS 2012 came out. At the time I compiled the extension on VS 2012 and only targeted VS 2012.
Then when VS 2013 came out I recompiled the extension so it could also be installed on VS 2013. The extension code itself works on VS 2012/2013/2015 without changes. So, to allow the installation on VS 2013 I only updated the .vsixmanifest
, changing the required VS version from:
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="11.0" />
to
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,12.0]" />
And it seemed to work fine.
However when I later got rid of my VS 2012 installation and wanted to compile the extension on VS 2013, I had a problem with the following references:
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Editor, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Text.UI, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
Version 11 of these assemblies could not be found. I edited the project file to:
<Reference Include="Microsoft.VisualStudio.CoreUtility" />
<Reference Include="Microsoft.VisualStudio.Editor" />
<Reference Include="Microsoft.VisualStudio.Text.Data" />
<Reference Include="Microsoft.VisualStudio.Text.UI" />
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf" />
Then it compiled and ran fine on VS 2013 but apparently the extension would then require a later version of these assemblies, only available on VS 2013. Thus the extension could no longer be installed on VS 2012. I'm now having a similar problem with VS 2015.
I thought I would install the VS 2012 SDK and that would provide me with version 11 of these assemblies, to compile against them, however this SDK cannot be installed without first installing VS 2012.
Is there any way to compile this extension from VS 2015, while allowing the extension to be installed on VS all the way back to version 2012?
Upvotes: 3
Views: 234
Reputation: 6865
Someone uploaded the required SDK assemblies on NuGet. Start searching here: https://www.nuget.org/packages?q=VSSDK.Shell
Upvotes: 3
Reputation: 6864
I have noticed that there are different versions of extensions for each version of Visual Studio.
If VS is specific about the versions of the assemblies it talks to I would suggest the short answer is no, you cannot have a single project with a single set of dependencies and create extensions that work with all versions of Visual Studio.
It might be possible just to create a copy of the correct versions of the assemblies required and still be able to compile an extension for an earlier release of Visual Studio in the latest release. But you would need to have the assemblies.
This is why I prefer to check third party assemblies into source control, and keep every version of the assembly used. You can manage it with tags and/or branches for each release of your extension.
Upvotes: 0