简体   繁体   English

NUnit DLL修订版不匹配

[英]NUnit DLL revision mismatch

I'm having this weird revision mismatch error. 我有这个奇怪的修订版本不匹配错误。 All my NUnit test projects used to work with NUnit 2.5.7, but now that I switched them to using NUnit v2.5.10, I keep on getting the following error: 我所有的NUnit测试项目都曾用于NUnit 2.5.7,但现在我将它们切换到使用NUnit v2.5.10,我继续收到以下错误:

FileLoadException: Could not load file or assembly 'nunit.framework, version 2.5.7... FileLoadException:无法加载文件或程序集'nunit.framework,版本2.5.7 ...

Note: I cleaned up, rebuilt, double checked the references, no problem there. 注意:我清理,重建,双重检查参考,没有问题。

Using the Assembly Binder Log Viewer (see below), it seems to me that the trigger of this error is the Spring.Testing.NUnit.dll... which seems weird given that the Spring.Testing.Nunit 1.3.2 Nuget page says in its Dependency List: NUnit (≥ 2.5.7) 使用Assembly Binder日志查看器(见下文),在我看来,这个错误的触发器是Spring.Testing.NUnit.dll ...这看起来很奇怪,因为Spring.Testing.Nunit 1.3.2 Nuget页面说在其依赖列表中: NUnit(≥2.5.7)

Any idea what I'm missing here? 知道我在这里缺少什么吗? Thanks in advance, 提前致谢,

TB. TB。

Assembly Binder Log Entry (02.07.2012 @ 16:06:35) 装配活页夹日志条目(02.07.2012 @ 16:06:35)

The operation failed. 操作失败。 Bind result: hr = 0x80131040. 绑定结果:hr = 0x80131040。 No description available. 没有可用的描述。

Assembly manager loaded from: C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\clr.dll Running under executable F:\\robin\\4-Development\\Workspace\\3rdParty\\NUnit\\2.5.10\\nunit-agent.exe --- A detailed error log follows. 程序集管理器从以下位置加载:C:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ clr.dll在可执行文件F:\\ robin \\ 4-Development \\ Workspace \\ 3rdParty \\ NUnit \\ 2.5.10 \\ nunit-agent.exe下运行---详细的错误日志如下。

=== Pre-bind state information === LOG: User = Mth\\tbourguignon LOG: DisplayName = nunit.framework, Version=2.5.7.10213, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77 (Fully-specified) LOG: Appbase = file:///F:/robin/4-Development/Workspace/Application LOG: Initial PrivatePath = Rh.Robin.Common.Tests\\bin\\Debug;Rh.Robin.Service.Test\\bin\\Debug;Rh.Robin.Domain.Unit.Test\\bin\\Debug;Rh.Robin.Service.Unit.Test\\bin\\Debug;Rh.Robin.Web.UI.MVC.Unit.Test\\bin\\Debug LOG: Dynamic Base = NULL LOG: Cache Base = C:\\Users\\tbourguignon.Mth\\AppData\\Local\\Temp\\nunit20\\ShadowCopyCache\\4980_634768419945070499 LOG: AppName = Tests_29030132 Calling assembly : Spring.Testing.NUnit, Version=1.3.2.40943 , Culture=neutral, PublicKeyToken=65e474d141e25e07. ===预绑定状态信息=== LOG:User = Mth \\ tbourguignon LOG:DisplayName = nunit.framework,Version = 2.5.7.10213,Culture = neutral,PublicKeyToken = 96d09a1eb7f44a77(完全指定)LOG:Appbase = file: /// F:/ robin / 4-Development / Workspace / Application LOG:Initial PrivatePath = Rh.Robin.Common.Tests \\ bin \\ Debug; Rh.Robin.Service.Test \\ bin \\ Debug; Rh.Robin.Domain。 Unit.Test \\ bin \\ Debug; Rh.Robin.Service.Unit.Test \\ bin \\ Debug; Rh.Robin.Web.UI.MVC.Unit.Test \\ bin \\ Debug LOG:Dynamic Base = NULL LOG:Cache Base = C:\\ Users \\ tbourguignon.Mth \\ AppData \\ Local \\ Temp \\ nunit20 \\ ShadowCopyCache \\ 4980_634768419945070499日志:AppName = Tests_29030132调用程序集: Spring.Testing.NUnit,Version = 1.3.2.40943 ,Culture = neutral,PublicKeyToken = 65e474d141e25e07。 === LOG: This bind starts in default load context. ===日志:此绑定在默认加载上下文中启动。 LOG: No application configuration file found. 日志:找不到应用程序配置文件。 LOG: Using host configuration file: LOG: Using machine configuration file from C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\config\\machine.config. 日志:使用主机配置文件:日志:使用C:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ config \\ machine.config中的计算机配置文件。 LOG: Post-policy reference: nunit.framework, Version=2.5.7.10213 , Culture=neutral, PublicKeyToken=96d09a1eb7f44a77 LOG: GAC Lookup was unsuccessful. 日志:政策后参考: nunit.framework,Version = 2.5.7.10213 ,Culture = neutral,PublicKeyToken = 96d09a1eb7f44a77日志:GAC查询失败。 LOG: Attempting download of new URL file:///F:/robin/4-Development/Workspace/Application/nunit.framework.DLL. 日志:尝试下载新的URL文件:/// F:/robin/4-Development/Workspace/Application/nunit.framework.DLL。 LOG: Attempting download of new URL file:///F:/robin/4-Development/Workspace/Application/nunit.framework/nunit.framework.DLL. 日志:尝试下载新的URL文件:/// F:/robin/4-Development/Workspace/Application/nunit.framework/nunit.framework.DLL。 LOG: Attempting download of new URL file:///F:/robin/4-Development/Workspace/Application/Rh.Robin.Common.Tests/bin/Debug/nunit.framework.DLL. 日志:尝试下载新的URL文件:/// F:/robin/4-Development/Workspace/Application/Rh.Robin.Common.Tests/bin/Debug/nunit.framework.DLL。 LOG: Assembly download was successful. 日志:程序集下载成功。 Attempting setup of file: F:\\robin\\4-Development\\Workspace\\Application\\Rh.Robin.Common.Tests\\bin\\Debug\\nunit.framework.dll LOG: Entering download cache setup phase. 尝试设置文件:F:\\ robin \\ 4-Development \\ Workspace \\ Application \\ Rh.Robin.Common.Tests \\ bin \\ Debug \\ nunit.framework.dll日志:进入下载缓存设置阶段。 LOG: Assembly Name is: nunit.framework, Version=2.5.10.11092 , Culture=neutral, PublicKeyToken=96d09a1eb7f44a77 WRN: Comparing the assembly name resulted in the mismatch: Revision Number ERR: The assembly reference did not match the assembly definition found . 日志: 程序集名称为:nunit.framework,Version = 2.5.10.11092 ,Culture = neutral,PublicKeyToken = 96d09a1eb7f44a77警告:比较程序集名称导致不匹配:修订号ERR:程序集引用与找到的程序集定义不匹配 ERR: Setup failed with hr = 0x80131040. 错误:安装失败,hr = 0x80131040。 ERR: Failed to complete setup of assembly (hr = 0x80131040). 错误:无法完成程序集的设置(hr = 0x80131040)。 Probing terminated. 探测终止。

Did you gain anything from referencing a newer dot-version of NUnit? 你从参考更新的点版NUnit中获得了什么? If not, the easiest thing you could do is go back and reference the older version of NUnit assemblies matching the version Spring is referencing in your code. 如果没有,您可以做的最简单的事情是返回并引用与Spring在代码中引用的版本匹配的旧版NUnit程序集。

The other option is to modify your (Spring) application's configuration to use binding redirects to pick up the newer version of NUnit assemblies. 另一种选择是修改(Spring)应用程序的配置,以使用绑定重定向来获取更新版本的NUnit程序集。

It makes me wonder if Spring's reference to NUnit's assembly had Specific Version set to true. 这让我想知道Spring对NUnit程序集的引用是否将Specific Version设置为true。 Seems unlikely, though. 但似乎不太可能。 Here's a reference on how .NET locates and binds assemblies at runtime . 这是一个关于.NET如何在运行时定位和绑定程序集的参考。

Somehow I managed to solve this issue... but I still don't know what caused it. 不知怎的,我设法解决了这个问题......但我仍然不知道是什么导致了这个问题。 I did a major cleanup of the references, excluding all the NUnit references from my project, removing all the DLLs and reintroducing the new DLL only. 我对引用进行了大量清理,排除了项目中的所有NUnit引用,删除了所有DLL并仅重新引入了新的DLL。 I can only guess that a DLL was stuck somewhere and Spring was picking it up instead of the new one... wild guess though :( 我只能猜测一个DLL被卡在某个地方而Spring正在捡起它而不是新的......虽然疯狂猜测:(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM