22

I'm using VSIX Manifest Designer under VS2013. I've added Microsoft.VisualStudio.Pro product identifier and [10.0,13.0) version range to install targets. Despite that fact, I still don't see my VS2010 Professional as an available installation target:

enter image description here

The source.extension.vsixmanifest file content is shown below:

<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
  <Metadata>
    <Identity Id="ae98c9e5-8e14-4c92-b45a-c4fd24a49123" Version="1.0" Language="en-US" Publisher="whosoever" />
    <DisplayName>MyExtension</DisplayName>
    <Description xml:space="preserve">whosoever</Description>
    <MoreInfo>http://www.myextension.com</MoreInfo>
    <License>LICENSE.txt</License>
    <Icon>icon.png</Icon>
    <PreviewImage>screenshot.png</PreviewImage>
  </Metadata>
  <Installation InstalledByMsi="false">
    <InstallationTarget Version="[10.0,13.0)" Id="Microsoft.VisualStudio.Pro" />
  </Installation>
  <Dependencies>
    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.5" />
    <Dependency Id="Microsoft.VisualStudio.MPF.11.0" DisplayName="Visual Studio MPF 11.0" d:Source="Installed" Version="11.0" />
  </Dependencies>
  <Assets>
    <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
  </Assets>
</PackageManifest>

What should be changed to enable installation of this extension to VS2010, 2012 and 2013?

superjos
  • 12,189
  • 6
  • 89
  • 134
jwaliszko
  • 16,942
  • 22
  • 92
  • 158

2 Answers2

31

What you have is the version 2 VSIX manifest, which is not compatible with Visual Studio 2010. Later Visual Studio versions respect version 1 of the manifest, so in order to support all 3 Visual Studio versions with a single manifest, you'll have to convert it to v1.0 manually (and make sure NOT to edit it with VS2012+, otherwise it will be converted back to v2.0).

Something like this:

<?xml version="1.0" encoding="utf-8"?>
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
  <Identifier Id="ae98c9e5-8e14-4c92-b45a-c4fd24a49123">
    <Name>MyExtension</Name>
    <Author>whosoever</Author>
    <Version>1.0</Version>
    <Description xml:space="preserve">Your decription.</Description>
    <Locale>1033</Locale>
    <SupportedProducts>
      <VisualStudio Version="10.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="11.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="12.0">
        <Edition>Pro</Edition>
      </VisualStudio>
    </SupportedProducts>
    <SupportedFrameworkRuntimeEdition MinVersion="4.0" />
  </Identifier>
  <Content>
    <VsPackage>|%CurrentProject%;PkgdefProjectOutputGroup|</VsPackage>
    <MefComponent>|%CurrentProject%|</MefComponent>
  </Content>
</Vsix>

You don't have to specify all product editions (called SKUs), Pro is enough, if, say, Ultimate is installed, it will be displayed instead.

Igal Tabachnik
  • 31,174
  • 15
  • 92
  • 157
  • If you open a version 1 vsixmanifest file in 2012+, it just opens as an XML file (without the designer). I've never had it try to convert the file. – Sam Harwell Mar 27 '14 at 18:05
  • @280Z28 Yes, you're right. I meant opening it with the VSIX Manifest editor. It will append the v2 schema inside the file. Not replacing the v1 one, but not reading it either. – Igal Tabachnik Mar 27 '14 at 19:55
  • 2
    This answer just rocks! Can't believe they changed the schema in a way that things must be finally done manually as long as you need to support VS2010 (this is the opposite of rocks)! – Patrick from NDepend team Jun 20 '14 at 09:57
  • 3
    How can i add Support for VS2015? Is this correct: ` Enterprise Pro ` – brighty Aug 25 '15 at 14:00
  • 4
    @brighty yup, that looks correct. You can even specify `Community` in 2015, to have your extension installable in the [free* community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx) edition as well. – Igal Tabachnik Aug 25 '15 at 14:07
  • @Igal Thanks for this hint! – brighty Aug 25 '15 at 14:09
  • Note that this appears to apply with the release of VS2017 which uses VSIX format 3. Building a VSIX with VS2017, it doesn't seem possible to target VS2015 and earlier. – Drew Noakes Mar 13 '17 at 14:40
1

It is working pretty good (Thanks a lot to Igal), if the VSIX is developed in VS 2012, and installed in VS 2015. However, the reverse is not working (means developed in VS 2015 and try to install in VS 2012) After analyzed Activitylog .xml, i found a work around

Could not load file or assembly 'Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

Workaround I did Remove VisualStudio.Shell.14.0 and Install VisualStudio.Shell.11.0 using Package manager console (Install-Package VSSDK.Shell.11), and installed in VS 2012. Now Working as expected