2014-05-15 34 views
5

Ottenere il seguente avviso da aspnet_compiler.exe durante la creazione di un pacchetto di distribuzione:avvertimento WebGrease durante la creazione di un pacchetto di distribuzione

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. 

Stessa cosa è successo prima ho aggiornato WebGrease dalla versione 1.3.0.0 provato entrambe le seguenti assemblaggio attacchi senza successo:

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

ho trascorso 2 giorni in questo già frittura configurazioni diverse e apprezzo molto ogni suggerimento o aiuto.

risposta

6

Dal messaggio di errore, il problema è nel framework .Net che si sta prendendo di mira. Fare clic con il tasto destro del mouse sul progetto, scegliere le proprietà e modificare il framework di riferimento .Net su 4.5.1. Ho avuto lo stesso problema dopo essermi trasferito da Visual Studio 2012 al 2013 e questo lo ha risolto per me. Spero che questo aiuti

3

Ho risolto questo problema con l'aggiunta di un riferimento System.Windows.Forms con la seguente configurazione 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> 

Ispirato answer.

Problemi correlati