0

I have seen that NuGet.exe contains an ExcludeVersion flag when installing packages. We have a solutions which already contains a large number of references. For example:

<Reference Include="Microsoft.SqlServer.Smo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
  <Private>True</Private>
  <HintPath>..\packages\Microsoft.SqlServer.Scripting.11.0.2100.61\lib\Microsoft.SqlServer.Smo.dll</HintPath>
</Reference>

Is there an easy way to update all of these existing references to not include the version number (11.0.2100.61 above) in the folder path? Originally these references were all added using the package manager in Visual Studio, but I don't see any way of specifying to not include the version number.

1

1 Answer 1

0

Short answer.

No, there is not.

See this: https://nuget.codeplex.com/workitem/1522

I think you have to:

  1. Run the VS Tool : Uninstall-Package Microsoft.SqlServer.Smo

  2. Run the NuGet command line.....with the ExcludeVersion flag.

    C:\WhereeverYouPutThis\NuGet.exe install Microsoft.SqlServer.Smo -ConfigFile "..nuget\nuget.config" -ExcludeVersion

  3. Re-do your references.

Yeah, that stinks.

My nuget.config file looks like this, FYI.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="repositoryPath" value="..\MyPackages" />
  </config>
</configuration>
1
  • Fingers crossed doing this in a nicer way is possible someday May 6, 2014 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.