“The located assembly's manifest definition does not match the assembly reference” on nuget package

送分小仙女□ 提交于 2019-12-05 09:32:43

I finally found the solution after much trying. The key was in the Assembly load trace.

LOG: Redirect found in application configuration file: 1.0.0.0 redirected to 1.1.0.0.

Here are the steps I took to resolve the issue. It might be possible to skip some of these but this worked for me:

  • Uninstall the nuget package Microsoft.AspNet.WebOptimization.WebForms

  • Delete bin folder

  • open web.config and locate the redirection.

It will look something like this:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
  </dependentAssembly>
</assemblyBinding>
  • I removed the entire assemblyBinding section from the web.config.

  • Finally re-install the Microsoft.AspNet.WebOptimization.WebForms package and rebuild.

I don't know where this section came from in the web.config but having removed it everything seems to be working once again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!