1

我正在尝试使用 NuGet 安装 Spring.Testing.NUnit,它迫使我更新依赖项,即使我已经有一个可接受的版本。它甚至没有将其更新到最新版本,即 2.6.0。

我可以使用 安装-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.
4

1 回答 1

2

Spring.Testing.Packages 需要 NUnit >= 2.5.7。NuGet 认为版本字符串的第三部分可以安全更新到(通常,它不特定于此包)。在这种情况下,NuGet 将选择版本至少为 2.5.7 且低于 2.6 的最高可能情况。

于 2012-06-13T07:27:52.037 回答