首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >生成部署包时的WebGrease警告

生成部署包时的WebGrease警告
EN

Stack Overflow用户
提问于 2014-05-15 17:36:29
回答 2查看 2.9K关注 0票数 5

在构建部署包时,从aspnet_compiler.exe获得以下警告:

代码语言:javascript
复制
ASPNETCOMPILER(0,0): Warning : The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: WebGrease, Version=1.6.5135.21930, Culture=neutral, PublicKeyToken=31bf3856ad364e35. The dependencies are: System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly.

在我从1.3.0.0版本更新WebGrease之前,也发生了同样的事情,我尝试了以下两个程序集绑定,但都没有成功:

代码语言:javascript
复制
<dependentAssembly>
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
  </dependentAssembly>

<dependentAssembly>
    <assemblyIdentity name="System.Windows.Forms" publicKeyToken="b77a5c561934e089" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>

我花了两天的时间已经炸了不同的配置,并将非常感谢任何提示或帮助。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-06-02 14:41:19

从错误消息来看,问题在您要针对的.Net框架中。右键单击项目,选择属性,并将.Net目标框架更改为4.5.1。从2012到2013年,我从visual搬到了同样的问题,这为我解决了这个问题。希望这能有所帮助

票数 6
EN

Stack Overflow用户

发布于 2016-06-24 07:41:35

我通过在System.Windows.Forms上添加一个引用来解决这个问题,web.config中的配置如下:

代码语言:javascript
复制
<system.web>
  <compilation debug="true" targetFramework="4.5.2">
    <assemblies>
      <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </assemblies>
  </compilation>
</system.web>

answer的启发。

票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23685112

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档