I had created a visual studio extension (VSIX) which was compatible with vs2010 and vs2012. It had Nuget Package Manager as a dependency. Now I want to make it compatible with vs2013. I added the vs2013 to the supported products. But, the istallation would always fail. Apparently, Nuget team have changed the Identfier for vsix extension for vs2013. I cannot change the identifier to new one as it will affect vs2010/12.

  <References>
    <Reference Id="NuPackToolsVsix.Microsoft.67e54e40-0ae3-42c5-a949-fddf5739e7a5">
      <Name>NuGet Package Manager</Name>
      <MoreInfoUrl>http://docs.nuget.org/</MoreInfoUrl>
    </Reference>
  </References>

Is there a way to add depndencies to vsix based on visual studio version. So that I can add one more reference to nuget for vs2013. OR is there any workaround to this?

The new identifier for vs2013 nuget extension is NuGet.67e54e40-0ae3-42c5-a949-fddf5739e6a5

有帮助吗?

解决方案

You can do either of the following:

  1. Remove the reference to the NuGet extension. This will result in a risk of package load errors or other errors if your users do not have NuGet installed, or if they have an outdated version of NuGet that your extension does not support.

  2. Ship separate VSIX packages of your extension for Visual Studio 2010-2012 and Visual Studio 2013.

The latter is likely the best approach. You can create both extensions from the same codebase by following the approach used in the Cloud Explorer extension (note there will be subtle differences because this extension doesn't support Visual Studio 2010, but yours does).

  1. Create a separate project file for the VS2013 extension in the same folder as the extension that targets 2010-2012. I highly recommend you use a visual diff tool to compare Rackspace.VisualStudio.CloudExplorer.11.csproj and Rackspace.VisualStudio.CloudExplorer.12.csproj to show the subtle differences that allow these to live side-by-side.

  2. Create subfolders Properties\vs2010 and Properties\vs2013 to hold the two separate versions of your source.extension.vsixmanifest file. Use the correct NuGet reference for each of these files.

If your project is open source on GitHub, I could help apply the changes and send a pull request.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top