WebGrease warning when building a deployment package
Asked Answered
C

2

5

Getting the following warning from aspnet_compiler.exe when building a deployment package:

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.

Same thing happened before I updated WebGrease from version 1.3.0.0 Tried both of the following assembly bindings without success:

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

I spent 2 days on this already frying different configurations and would greatly appreciate any hint or help.

Corkhill answered 15/5, 2014 at 17:36 Comment(0)
K
6

From the error message, the problem is in the .Net framework you are targeting. Right click on the project, choose properties, and change the .Net target framework to 4.5.1. I had the same problem after moving from visual studio 2012 to 2013 and that fixed it for me. Hope this helps

Karlin answered 2/6, 2014 at 14:41 Comment(0)
A
10

I solved this issue by adding a reference on System.Windows.Forms with the following configuration in 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>

Inspired by answer.

Askwith answered 24/6, 2016 at 7:41 Comment(0)
K
6

From the error message, the problem is in the .Net framework you are targeting. Right click on the project, choose properties, and change the .Net target framework to 4.5.1. I had the same problem after moving from visual studio 2012 to 2013 and that fixed it for me. Hope this helps

Karlin answered 2/6, 2014 at 14:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.