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

前端 未结 30 2103
北恋
北恋 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 02:02

    Manually deleting the old assembly from folder location and then adding the reference to new assemblies might help.

    0 讨论(0)
  • 2020-11-22 02:03

    The other answers wouldn't work for me. If you don't care about the version and you just want your app to run then right click on the reference and set 'specific version' to false...This worked for me. enter image description here

    0 讨论(0)
  • 2020-11-22 02:03

    No solution worked for me. I tried clean project solution, remove bin, update package, downgrade package and so on... After two hours I loaded default App.config from project with assemblies and there I changed wrong reference version from:

    <dependentAssembly>
        <assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.5.0.0" newVersion="5.5.0.0" />
    </dependentAssembly>
    

    to:

    <dependentAssembly>
        <assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.14.0.0" newVersion="5.5.0.0" />
    </dependentAssembly>
    

    After this I cleaned project, build it again and it worked. No warning no problem.

    0 讨论(0)
  • 2020-11-22 02:06

    The .NET Assembly loader:

    • is unable to find 1.2.0.203
    • but did find a 1.2.0.200

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

    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.

    0 讨论(0)
  • 2020-11-22 02:06

    If you are using Visual Studio, try "clean solution" and then rebuild your project.

    0 讨论(0)
  • 2020-11-22 02:07

    I would like to just add that I was creating a basic ASP.NET MVC 4 project and added DotNetOpenAuth.AspNet via NuGet. This resulted in the same error after I referenced a mismatching DLL file for Microsoft.Web.WebPages.OAuth.

    To fix it I did a Update-Package and cleaned the solution for a full rebuild.

    That worked for me and is kind of a lazy way, but time is money:-P

    0 讨论(0)
提交回复
热议问题