2015-09-19 23 views
6

Sto cercando di creare un'applicazione Android utilizzando Xamarin e Visual Studio 2015 con un altro amico con controllo del codice sorgente.package NuGet causa problemi in Visual Studio 2015 e Xamarin

Tutto è andato bene fino a quando il mio amico ha aggiunto un progetto e ha utilizzato i pacchetti NuGet.

Dopo ho attivato l'ultima versione e ho cercato di creare la soluzione ho ricevuto il messaggio di errore:

Severity Code Description Project File Line 
Error  This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props. iBuy.API C:\Users\איציק\Source\Workspaces\iBuy\IBuy\iBuy.API\iBuy.API.csproj 164 

Ho guardato alcune soluzioni per questo problema e provato a disinstallare e Microsoft.CodeDom.Providers.DotNetCompilerPlatform Microsoft.Net.Compilers pacchetti e ri installarli ma non ha aiutato. Nella mia soluzione non ho nemmeno una cartella \ packages \ Microsoft.Net.Compilers.1.0.0 \ build.

Tutto nel ripristino del pacchetto NuGet è già controllato e nella mia soluzione non sono presenti file ".nuget".

Cosa posso fare per eliminare quel messaggio di errore?

Grazie in anticipo!

risposta

12

Questo messaggio di errore verrà verifica perché non si dispone il file \ NuGet.targets .nuget.

per risolvere il problema si potrebbe smettere di usare ripristinare il pacchetto NuGet basato MSBuild o aggiungere il file .nuget/NuGet.targets al controllo del codice sorgente.

Il ripristino del pacchetto NuGet basato su MSBuild è deprecato dal team NuGet. E aggiunge alcuni elementi in più per il file di progetto (.csproj):

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> 
    <PropertyGroup> 
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> 
    </PropertyGroup> 
    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" /> 
</Target> 
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> 

Si può avere più elementi nell'elemento EnsureNuGetPackageBuildImports bersaglio. È possibile rimuoverli dal file di progetto e affidarsi invece a Visual Studio per ripristinare i pacchetti NuGet.

+0

funziona! grazie – nosensus

+0

Abbracci e baci a te. – bonitzenator

Problemi correlati