2012-06-13 60 views
1

我試圖用NuGet安裝Spring.Testing.NUnit,它迫使我更新依賴項,即使我已經有一個可接受的版本。它甚至不會更新到最新版本,即2.6.0。爲什麼NuGet強制升級已經滿足的依賴項?

我可以-IgnoreDependencies安裝,但是當我做,我出錯誤與錯誤Could not load file or assembly 'nunit.framework, Version=2.6.0.12051 是在Spring.Testing.NUnit包錯了它需要什麼版本的NUnit運行測試?

PM> Install-Package NUnit -Version 2.5.7.10213 
'NUnit 2.5.7.10213' already installed. 
Successfully added 'NUnit 2.5.7.10213' to Services.Tests.Unit. 

PM> Install-Package Spring.Testing.NUnit 
Attempting to resolve dependency 'Common.Logging (= 1.2.0)'. 
Attempting to resolve dependency 'NUnit (= 2.5.7)'. 
Attempting to resolve dependency 'Spring.Core (= 1.3.2)'. 
Attempting to resolve dependency 'Spring.Data (= 1.3.2)'. 
Attempting to resolve dependency 'Spring.Aop (= 1.3.2)'. 
Successfully installed 'NUnit 2.5.10.11092'. 
Successfully installed 'Spring.Testing.NUnit 1.3.2'. 
Successfully removed 'NUnit 2.5.7.10213' from Services.Tests.Unit. 
Successfully added 'NUnit 2.5.10.11092' to Services.Tests.Unit. 
Successfully added 'Spring.Testing.NUnit 1.3.2' to Services.Tests.Unit. 

回答

2

Spring.Testing.Packages需要NUnit> = 2.5.7。 NuGet認爲版本字符串的第三部分可以安全地更新到(通常,它不是特定於此包)。在這種情況下,NuGet將選擇版本至少爲2.5.7且低於2.6的最高可能情況。

+0

你也可以在執行'Install-Package'時使用'-IgnoreDependencies'開關,它會[告訴NuGet不檢索任何依賴關係。](http://docs.nuget.org/docs/reference/package-manager -console - PowerShell的參考#安裝包) – TRayburn