The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

前端 未结 8 1649
醉梦人生
醉梦人生 2021-01-17 09:33

After signing the third parties assemblies and adding them to GAC I am getting the below error: also the Assembly Binder Log Entry shows this error

It says mismatch

相关标签:
8条回答
  • 2021-01-17 10:33

    I had a different cause: in my case, I had used various nuget package versions previously, and I had an app.config which for some reason had been automatically generated with this kind of content:

      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" />
      </dependentAssembly>
    

    So I only had Version 1.1.0.0 installed, but because of this redirect instruction, it looked for 1.1.1.0 even though Visual Studio had the nuget for 1.1.0.0 installed. Changing the newVersion to 1.1.0.0 fixed everything:

      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.0.0" />
      </dependentAssembly>
    
    0 讨论(0)
  • 2021-01-17 10:36

    One way to solve this could be, going under "Manage NuGet Packages for Solution" by doing right click in the solution explorer. Once there, go to "Consolidate" and find the package that is causing the problems. Make sure that all the projects within the solution are using the same version.

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