定位的程序集的清单定义与程序集引用不匹配

编程入门 行业动态 更新时间:2024-10-23 22:34:23
本文介绍了定位的程序集的清单定义与程序集引用不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图在 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 或应用程序路径中,确保它可以找到正确的程序集.另见 docs.microsoft/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 docs.microsoft/archive/blogs/junfeng/the-located-assemblys-manifest-definition-with-name-xxx-dll-does-not-match-the-assembly-reference.

更多推荐

定位的程序集的清单定义与程序集引用不匹配

本文发布于:2023-11-03 16:11:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555538.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序   清单   不匹配   定义

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!