Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget seems to install the wrong version of System.Collections.Immutable

I have a confusing issue with Nuget. I have a number of projects who claim to have System.Collections.Immutable installed at version 1.3.0 but if I look at the version of the dll in all the references I see version 1.2.1.0

When I open up the DLL with JustDecompile I see enter image description here which declares that the DLL version is indeed 1.2.1.0 but has been installed in directory packages\System.Collections.Immutable.1.3.0

A typical packages.config file will contain

<package id="System.Collections.Immutable" version="1.3.0" targetFramework="net452" />

and the csproj is

<Reference 
  Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\System.Collections.Immutable.1.3.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
  <Private>True</Private>
</Reference>

If I try to open the downloaded nuget package from the gallery and open with nuget package explorer I get

enter image description here

like image 557
bradgonesurfing Avatar asked Dec 20 '16 14:12

bradgonesurfing


1 Answers

Got the same problem recently. System.Collections.Immutable is a multi-target package, so the version of the assembly imported to your solution depends on the target. For instance, if you are in a .Net Framework project, this is the file stored in portable-net45+win8+wp8+wpa81 that will be used, hence the different version.

like image 157
Jonathan Prt Avatar answered Sep 20 '22 11:09

Jonathan Prt