升级到WebGrease版本1.3.0导致错误只在生产服务器 [英] Upgrading WebGrease to version 1.3.0 causes error only on production server

查看:209
本文介绍了升级到WebGrease版本1.3.0导致错误只在生产服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,这个问题的答案,不解决我的错误:

First off, answers to this question,do NOT solve my error:

<一个href=\"http://stackoverflow.com/questions/13619255/upgrading-webgrease-to-version-1-3-0-gets-me-error\">Upgrading WebGrease到1.3.0版本,让我错误

我有以下bindingredirect我的生产服务器上:

I have the following bindingredirect on my production server:

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

我所需要的微软的ASP.NET Web优化框架我的生产服务器上的下列DLL的:

I have the following DLL's on my production server that are required for the Microsoft ASP.NET Web Optimization Framework:


  1. System.Web.Optimization.dll 1.0.0.0(这不是pre-发布版本)

  2. Antlr3.Runtime.dll 3.3.1.7705

  3. Webgrease.dll 1.3.0.0

我收到以下错误:

无法加载文件或程序集WebGrease,版本= 1.0.0.0,文化=中性公钥= 31bf3856ad364e35或它的一个依赖。找到的程序集清单定义不匹配程序集引用。 (异常来自HRESULT:0x80131040)

我已经检查了GAC,我已经删除了所有的临时文件夹的ASP.NET,我试图从我的配置删除 NEWVERSION 属性&LT; bindingRedirect&GT; 。我不知道什么是告诉ASP.NET寻找WebGrease 1.0

I have checked the GAC, I have deleted all Temporary ASP.NET folders, I have tried removing the newVersion attribute from my config <bindingRedirect>. I am not sure what is telling ASP.NET to look for WebGrease 1.0

推荐答案

终于想通了,为什么这不是对我来说,尽管其他用户说,它正在为他们工作。

Finally figured out why this was not working for me despite other users saying that it was working for them.

我有以下绑定重定向在我的web.config文件以强制 System.Web.Optimization 装配使用,而不是较新的版本:

I had the following binding redirection in my web.config file to force the System.Web.Optimization assembly to use the newer version instead:

<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),以找出更多信息,发现绑定进程甚至没有看重定向指令。

It was just like other users had, but it didn't work. Then I used the fusion log viewer (Fuslogvw.exe) to figure out more information and discovered that the binding process didn't even look at the redirect instruction.

终于想通了,必须的的放在根XML命名空间...。如果我删除从我的&LT以下;结构&gt; 元素,它的工作原理:的xmlns =htt​​p://schemas.microsoft.com/.NetConfiguration/ V2.0

Finally figured out that there must not be an XML namespace on the root ... . If I remove the following from my <configuration> element it works: xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"

此外,只要确保你有指定以下XML命名空间中的&LT; assemblyBinding的xmlns =瓮:架构 - 微软COM:asm.v1&GT; 元素。

Also, just make sure you have the following XML namespace specified on the <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> element.

最后!!

这篇关于升级到WebGrease版本1.3.0导致错误只在生产服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆