2016-12-20 73 views
3

我對Nuget有一個令人困惑的問題。我有一些誰主張在版本1.3.0 安裝System.Collections.Immutable的項目,但如果我看DLL的版本中所有引用我看到的版本1.2.1.0Nuget似乎安裝了錯誤版本的System.Collections.Immutable

當我打開了它宣稱的DLL版本確實1.2.1.0但已經被安裝在目錄封裝,JustDecompile我看到 enter image description here 的DLL \ System.Collections.Immutable.1.3.0

典型packages.config文件將包含

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

和的csproj是

<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> 

如果我嘗試打開從庫中下載的NuGet包,並與NuGet包管理器中打開我得到

enter image description here

+0

當我在匿名類型列表中添加'OrderBy'時,我開始面對這個問題,但是從nuget安裝'System.Collections.Immutable'包解決了錯誤。 – Anil

回答

2

的NuGet包版本和程序集版本不一定相同。對於哪一個版本都沒有限制。

因此,看看System.Collections.Immutable 1.3.0程序集版本是1.2.1.0爲NuGet包中的程序集。

如果您無法打開NuGet包資源管理器中的NuGet包,則可以在zip文件應用程序(如7-zip)中打開它。或者只需將該文件重命名爲.zip,然後使用內置的Windows zip文件提取器將其打開。

+0

以前版本的庫和nuget包都是1.2.0,然後庫促進到1.2.1,nuget包到1.3.0。我同意,理論上他們不需要匹配,但這種氣味。對相同包的以前nuget版本的隨機採樣具有程序集版本和nuget版本匹配。 – bradgonesurfing

+0

我在corefx上添加了一個問題,要求解釋。 https://github.com/dotnet/corefx/issues/14640 – bradgonesurfing