首先,回答这个问题,不要解决我的错误:
将 WebGrease 升级到版本 1.3.0 出现错误
我的生产服务器上有以下绑定重定向:
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
我的生产服务器上有 Microsoft ASP.NET Web Optimization Framework 所需的以下 DLL:
- System.Web.Optimization.dll 1.0.0.0(这不是预发行版本)
- Antlr3.Runtime.dll 3.3.1.7705
- Webgrease.dll 1.3.0.0
我收到以下错误:
Could not load file or assembly 'WebGrease, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
我已检查 GAC,已删除所有临时 ASP.NET 文件夹,我已尝试删除newVersion
我的配置中的属性<bindingRedirect>
。我不确定是什么告诉 ASP.NET 寻找 WebGrease 1.0
终于弄清楚为什么这对我不起作用,尽管其他用户说这对他们有用。
我的 web.config 文件中有以下绑定重定向来强制System.Web.Optimization
程序集以使用较新版本代替:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
就像其他用户一样,但它不起作用。然后我使用融合日志查看器(Fuslogvw.exe)找出更多信息,发现绑定过程甚至没有查看重定向指令。
最后发现一定有not是根上的 XML 命名空间...。如果我从我的<configuration>
它起作用的元素:xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"
另外,只需确保在以下位置指定了以下 XML 命名空间:<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
元素。
最后!!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)