Ottenuto un brutto errore dopo aver spostato una soluzione da Visual Studio 2010 al 2012. La build è soddisfacente e tutto funziona perfettamente localhost. Ho un nuovo progetto MVC4 che richiede .NET 4.5, quindi ho installato il framework 4.5 sul build server. La build è buona ma MSBuild non riesce a copiare DotNetOpenAuth.Core.dll dalla sua posizione del pacchetto nella directory Bin. Il problema è dovuto al fatto che, sebbene il progetto specifico abbia come obiettivo il framework 4.0, credo che MSBuild controlli la dipendenza dall'assembly System.Net.Http del framework .NET 4.5 come parte del suo CoreBuild.System.Net.Http non può essere risolto nel framework attualmente selezionato .NET 4.0
codice di avviso = "MSB3268" Il riferimento primario \ packages \ DotNetOpenAuth.Core.4.3.0.13117 \ lib \ net40-full \ DotNetOpenAuth.Core.dll "non può essere risolto perché ha una dipendenza indiretta sul framework assembly "System.Net.Http, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" che non è stato risolto nel framework attualmente selezionato. ".NETFramework, Version = v4.0". Per risolvere questo problema, rimuovere il riferimento "c: \ cc \ kazork \ code \ trunk \ src \ packages \ DotNetOpenAuth.Core.4.3.0.13117 \ lib \ net40-full \ DotNetOpenAuth.Core.dll" o reindirizzare l'applicazione a una versione di framework che contiene "Sistema .Net.Http, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a
Ecco la mia confezione:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ChardinJs" version="1.0.3" targetFramework="net40" />
<package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net40" />
<package id="DotNetOpenAuth.AspNet" version="4.3.0.13117" targetFramework="net40" />
<package id="DotNetOpenAuth.Core" version="4.3.0.13117" targetFramework="net40" />
<package id="DotNetOpenAuth.OAuth.Consumer" version="4.3.0.13117" targetFramework="net40" />
<package id="DotNetOpenAuth.OAuth.Core" version="4.3.0.13117" targetFramework="net40" />
<package id="DotNetOpenAuth.OpenId.Core" version="4.3.0.13117" targetFramework="net40" />
<package id="DotNetOpenAuth.OpenId.RelyingParty" version="4.3.0.13117" targetFramework="net40" />
<package id="EntityFramework" version="5.0.0" targetFramework="net40" />
<package id="flexigrid" version="1.1.0" targetFramework="net40" />
<package id="jQuery" version="1.9.1" targetFramework="net40" />
<package id="Microsoft.AspNet.FriendlyUrls.Core" version="1.0.0" targetFramework="net40" />
<package id="Microsoft.AspNet.Membership.OpenAuth" version="1.0.1" targetFramework="net40" />
<package id="Microsoft.AspNet.SignalR.Core" version="1.1.1" targetFramework="net40" />
<package id="Microsoft.AspNet.SignalR.JS" version="1.1.1" targetFramework="net40" />
<package id="Microsoft.AspNet.SignalR.Owin" version="1.1.1" targetFramework="net40" />
<package id="Microsoft.AspNet.SignalR.SystemWeb" version="1.1.1" targetFramework="net40" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.0.0" targetFramework="net40" />
<package id="Microsoft.Owin.Host.SystemWeb" version="1.0.1" targetFramework="net40" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
<package id="Newtonsoft.Json" version="5.0.5" targetFramework="net40" />
<package id="Owin" version="1.0" targetFramework="net40" />
<package id="PayPalCoreSDK" version="1.1.1" targetFramework="net40" />
<package id="PayPalMerchantSDK" version="2.3.98" targetFramework="net40" />
<package id="Select2.js" version="3.3.2" targetFramework="net40" />
<package id="toastr" version="1.2.2" targetFramework="net40" />
<package id="Twitter.Bootstrap" version="2.3.2" targetFramework="net40" />
<package id="WebGrease" version="1.3.0" targetFramework="net40" />
</packages>
Ho fatto riferimento a System.Net.Http e viene copiato nel cestino. Il progetto in questione ha come obiettivo il framework 4.0. La mia versione System.Net.Http è per il framework 4.0.
Hai trovato il vero problema a questo? Penso davvero che sia strano che la dll che hai nella tua cartella del pacchetto non sia usata.Ho esattamente lo stesso problema, ma non ha aiutato a copiare il file system.net.http. –
Sì, questo è ciò che ha risolto il mio problema. –
Le mie build hanno smesso di funzionare dopo aver eseguito il downgrade da .net 4.5 a 4.0. Nel mio caso, System.Net.Http e System.Web.Http sono entrambi mancanti nella cartella .NETFramework \ v4.0 sul build server. Grazie per aver condiviso la tua risoluzione! –