定位的程序集的清单定义与程序集引用不匹配 [英] The located assembly's manifest definition does not match the assembly reference

查看:32
本文介绍了定位的程序集的清单定义与程序集引用不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 C# Windows 窗体应用程序 (Visual Studio 2005) 中运行一些单元测试,但出现以下错误:

I am trying to run some unit tests in a C# Windows Forms application (Visual Studio 2005), and I get the following error:

System.IO.FileLoadException: 无法加载文件或程序集Utility, Version=1.2.0.200, Culture=neutral, PublicKeyToken=764d581291d764f7"或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(来自 HRESULT 的异常:0x80131040)**

System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=1.2.0.200, Culture=neutral, PublicKeyToken=764d581291d764f7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)**

在 x.Foo.FooGO()

at x.Foo.FooGO()

在 Foo.cs:line 123 中的 x.Foo.Foo2(String groupName_)

at x.Foo.Foo2(String groupName_) in Foo.cs:line 123

在 FooTests.cs 中的 x.Foo.UnitTests.FooTests.TestFoo():line 98**

at x.Foo.UnitTests.FooTests.TestFoo() in FooTests.cs:line 98**

System.IO.FileLoadException: 无法加载文件或程序集Utility, Version=1.2.0.203, Culture=neutral, PublicKeyToken=764d581291d764f7"或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(来自 HRESULT 的异常:0x80131040)

System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=1.2.0.203, Culture=neutral, PublicKeyToken=764d581291d764f7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

我查看了我的参考资料,我只有一个参考Utility version 1.2.0.203(另一个是旧的).

I look in my references, and I only have a reference to Utility version 1.2.0.203 (the other one is old).

关于如何找出试图引用此 DLL 文件的旧版本的内容有什么建议吗?

Any suggestions on how I figure out what is trying to reference this old version of this DLL file?

此外,我认为我的硬盘驱动器上什至没有这个旧组件.有没有什么工具可以搜索这个旧版本的程序集?

Besides, I don't think I even have this old assembly on my hard drive. Is there any tool to search for this old versioned assembly?

推荐答案

.NET 程序集加载器:

The .NET Assembly loader:

  • 无法找到 1.2.0.203
  • 但确实找到了 1.2.0.200

此程序集与请求的内容不匹配,因此您会收到此错误.

This assembly does not match what was requested and therefore you get this error.

简单来说,就是找不到被引用的程序集.通过将它放在 GAC 或应用程序路径中,确保它可以找到正确的程序集.另见 https://docs.microsoft.com/archive/blogs/junfeng/the-located-assemblys-manifest-definition-with-name-xxx-dll-does-not-match-the-程序集参考.

In simple words, it can't find the assembly that was referenced. Make sure it can find the right assembly by putting it in the GAC or in the application path. Also see https://docs.microsoft.com/archive/blogs/junfeng/the-located-assemblys-manifest-definition-with-name-xxx-dll-does-not-match-the-assembly-reference.

这篇关于定位的程序集的清单定义与程序集引用不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆