The located assembly's manifest definition does not match the assembly reference

前端 未结 30 2642
北恋
北恋 2020-11-22 01:41

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: Co

30条回答
  •  不要未来只要你来
    2020-11-22 01:50

    Here's my method of fixing this issue.

    1. From the exception message, get the name of the "problem" library and the "expected" version number.

    1. Find all copies of that .dll in your solution, right-click on them, and check which version of the .dll it is.

    Okay, so in this example, my .dll is definitely 2.0.5022.0 (so the Exception version number is wrong).

    1. Search for the version number which was shown in the Exception message in all of the .csproj files in your solution. Replace this version number with the actual number from the dll.

    So, in this example, I would replace this...

    
    

    ... with this...

    
    

    Job done !

提交回复
热议问题