HRESULT: 0x80131040: The located assembly's manifest definition does not match the assembly reference

后端 未结 19 2294
庸人自扰
庸人自扰 2020-12-02 19:27

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

getting this when running nunit through ncover. Any idea?

相关标签:
19条回答
  • 2020-12-02 20:04

    This usually happens when the version of one of the DLLs of the testing environment does not match the development environment.

    Clean and Build your solution and take all your DLLs to the environment where the error is happening that should fix it

    0 讨论(0)
  • 2020-12-02 20:04

    In my particular situation, I got this as a result of a CreateObject done in VBScript. The cause in my case was a version of the assembly that resided in the GAC, that was older than the one I had compiled. (trying to solve an earlier problem, I installed the assembly in the GAC).

    So, if you're working with COM visible classes, then be sure you remove older versions of your assembly from the GAC, before registering your new assembly with RegASM.

    0 讨论(0)
  • 2020-12-02 20:05

    I got this error when working in the Designer. I had been developing in VS 2012, but "upgraded" to 2017 over the past couple days. Solution was to close and reopen VS.

    It may be related to a bug which I've seen reported elsewhere, where the Reference Manager does not work? In that situation, the following error message is encountered when trying to add a reference in the Solution Explorer:

    "Error HRESULT E_FAIL has been returned from a call to a COM component."

    My workaround was to close the solution, reopen in VS2012, add the reference, close 2012 and reopen 2017. Ridiculous that 2017 should have been released with such an obvious bug.

    0 讨论(0)
  • 2020-12-02 20:06

    Just Check your webconfig file and remove this code :-

    <dependentAssembly>
        <assemblyIdentity name="itextsharp" publicKeyToken="8354ae6d2174ddca" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.5.13.0" newVersion="5.5.13.0" />
      </dependentAssembly>
    
    0 讨论(0)
  • 2020-12-02 20:09

    In my case it was happening because of WebGrease. I updated it to the latest version (using NuGet) but it was conflicted with the dependencies. I manually added the below code in web.config and it worked as a charm.

    <dependentAssembly>
        <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
    </dependentAssembly>
    

    Please note my solution will only work when the error is related to WebGrease. The error code will remain the same. Also, you need to change the version in oldVersion and newVersion accordingly.

    0 讨论(0)
  • 2020-12-02 20:09

    My WPF project referenced 3 custom dlls. I updated one of them, deleted the reference and added the reference to the new dll. It also showed the correct version number in the properties of the reference. It was rebuilding without an error.

    But when the application was running, the failure "The located assembly's manifest .." occured, mentioning the old version.

    After searching for a solution for hours and reading couple of threads like this, I remembered the other dlls. One of the other dlls was referencing the old version, and that's why the failure occured. After rebuilding the 2nd dll and recreating both references in my WPF project, the failure was gone.

    Don't forget to check your other dlls!

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