. Advertisement .
. Advertisement .
I get an error
System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=22.214.171.124, 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)** at x.Foo.FooGO() at x.Foo.Foo2(String groupName_) in Foo.cs:line 123 at x.Foo.UnitTests.FooTests.TestFoo() in FooTests.cs:line 98** System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=126.96.36.199, 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)
when trying to run some unit tests in a C# Windows Forms application (VS 2005). How to fix the the located assembly’s manifest definition does not match the assembly reference error? Please give me some advice.
The cause: As this assembly doesn’t quite match what was requested, you will receive this error. Because the.NET Assembly loader cannot find
188.8.131.52while it finds a
You can simply understand that it can’t find the assembly that was mentioned. Put it in the GAC or the application path to ensure it can find the proper assembly.
Any assembly version will be redirected to the version
184.108.40.206using the code below. We have a script that will always renew this reference in the
App.config, ensuring that we never need to deal with this problem again.
You may obtain the assembly
publicKeyTokenand generate this block from the.dll file itself by using reflection.
To resolve this problem, there are a few things you can do. To search your hard disk for the assembly (.dll), use Windows file search. After you have a list, click View->Choose details and then select “File Version”. This will show you the version number in your list of results.
Lars also suggested that you check your GAC to determine which version is there. The Microsoft article states assemblies in the GAC cannot be copied locally during a build. You might have to remove the older version before you do a complete rebuild.
To find out more about binding failures, use fuslogvw.exe that comes with Visual Studio. Microsoft provides information on this tool. You will need to enable logging by changing the