问题:
I am trying to run some unit tests in a C# Windows Forms application (Visual Studio 2005), and I get the following error: 我试图在C#Windows窗体应用程序(Visual Studio 2005)中运行一些单元测试,但出现以下错误:
System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=1.2.0.200, Culture=neutral, PublicKeyToken=764d581291d764f7' or one of its dependencies. System.IO.FileLoadException:无法加载文件或程序集“实用程序,版本= 1.2.0.200,区域性=中性,PublicKeyToken = 764d581291d764f7”或其依赖项之一。 The located assembly's manifest definition does not match the assembly reference. 找到的程序集的清单定义与程序集引用不匹配。 (Exception from HRESULT: 0x80131040)** (HRESULT的异常:0x80131040)**
at x.Foo.FooGO() 在x.Foo.FooGO()
at x.Foo.Foo2(String groupName_) in Foo.cs:line 123 在Foo.cs:第123行的x.Foo.Foo2(String groupName_)
at x.Foo.UnitTests.FooTests.TestFoo() in FooTests.cs:line 98** 在FooTests.cs中的x.Foo.UnitTests.FooTests.TestFoo():行98 **
System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=1.2.0.203, Culture=neutral, PublicKeyToken=764d581291d764f7' or one of its dependencies. System.IO.FileLoadException:无法加载文件或程序集“实用程序,版本= 1.2.0.203,区域性=中性,PublicKeyToken = 764d581291d764f7”或其依赖项之一。 The located assembly's manifest definition does not match the assembly reference. 找到的程序集的清单定义与程序集引用不匹配。 (Exception from HRESULT: 0x80131040) (来自HRESULT的异常:0x80131040)
I look in my references, and I only have a reference to Utility version 1.2.0.203
(the other one is old). 我查看了自己的参考文献,并且仅参考了Utility version 1.2.0.203
(另一个是旧的)。
Any suggestions on how I figure out what is trying to reference this old version of this DLL file? 关于我如何找出试图引用此DLL文件旧版本的任何建议?
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? 有什么工具可以搜索这个旧版本的程序集吗?
解决方案:
参考一: https://stackoom.com/question/twA/找到的程序集的清单定义与程序集引用不匹配参考二: https://oldbug.net/q/twA/The-located-assembly-s-manifest-definition-does-not-match-the-assembly-reference
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4258603