gpt4 book ai didi

.net - 构建部署包时的 WebGrease 警告

转载 作者:行者123 更新时间:2023-12-04 17:20:16 68 4
gpt4 key购买 nike

构建部署包时从 aspnet_compiler.exe 收到以下警告:

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 之前发生了同样的事情
尝试了以下两种程序集绑定(bind)均未成功:
<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>

我花了 2 天时间在这个已经油炸不同的配置上,非常感谢任何提示或帮助。

最佳答案

我通过在 上添加引用解决了这个问题。 System.Windows.Forms web.config 中具有以下配置:

<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 .

关于.net - 构建部署包时的 WebGrease 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23685112/

68 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com