2015-09-10 7 views
8

sto ottenendo un errore quando provo ad installare alcun pacchetto dal NuGet in VS Community Edition 2015."Fine della registrazione directory centrale non è stato trovato" - NuGet in comunità VS 2015

Attempting to gather dependencies information for package 'Microsoft.Net.Http.2.2.29' with respect to project 'ClassLibrary1', targeting '.NETFramework,Version=v4.5.2' 
Attempting to resolve dependencies for package 'Microsoft.Net.Http.2.2.29' with DependencyBehavior 'Lowest' 
Resolving actions to install package 'Microsoft.Net.Http.2.2.29' 
Resolved actions to install package 'Microsoft.Net.Http.2.2.29' 
Install failed. Rolling back... 
Package 'Microsoft.Bcl.Build 1.0.14' does not exist in project 'ClassLibrary1' 
Package 'Microsoft.Bcl.Build 1.0.14' does not exist in folder 'C:\Users\441793\documents\visual studio 2015\Projects\ClassLibrary1\packages' 
System.IO.InvalidDataException: End of Central Directory record could not be found. 
    at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() 
    at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen) 
    at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding) 
    at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode) 
    at NuGet.Packaging.NuGetPackageUtils.ExtractPackage(String targetPath, FileStream stream) 
    at NuGet.Packaging.NuGetPackageUtils.<>c__DisplayClass1_0.<<InstallFromStreamAsync>b__0>d.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 
    at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLocked>d__0`1.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
    at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLocked>d__0`1.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 
    at NuGet.Packaging.NuGetPackageUtils.<InstallFromStreamAsync>d__1.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult() 
    at NuGet.Protocol.Core.v3.GlobalPackagesFolderUtility.<AddPackageAsync>d__1.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 
    at NuGet.Protocol.Core.v3.DownloadResourceV3.<GetDownloadResourceResultAsync>d__4.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at NuGet.PackageManagement.PackageDownloader.<GetDownloadResourceResultAsync>d__1.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) 
    at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__42.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
    at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__42.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at NuGet.PackageManagement.UI.UIActionEngine.<ExecuteActionsAsync>d__5.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at NuGet.PackageManagement.UI.UIActionEngine.<PerformActionAsync>d__3.MoveNext() 
========== Finished ========== 

Messaggio di errore che ricevo è nella scheda Elenco errori è

End of Central Directory record could not be found 

ho provato dall'applicazione Console alle biblioteche di classe e ottenere questo errore per tutti i pacchetti ho provato ad installare.

NuGet versione è: 3.0.60624.657

Qualsiasi aiuto sarà apprezzato

+0

Ciò potrebbe essere dovuto al tentativo di decomprimere un file * .gz o * .7z? – jp2code

+4

@ jp2code Ho scoperto il problema. Era perché il gestore di pacchetti stava provando a decomprimere un file * .zip corrotto (l'eccezione non era gestita). Il file è stato corrotto a causa della politica del firewall della mia società che ha bloccato il dominio nuget e risultante in un file 1kb. Grazie per l'interesse –

+0

Prova a installare utilizzando la console di Package Manager – Curiousity

risposta

9

Andate nella vostra cartella della soluzione e cancellare la cartella "pacchetti". Dovrai fare clic con il tasto destro del mouse sulla soluzione e selezionare "Gestisci pacchetti" e fare clic sul pulsante "Ripristina" nella parte superiore dello schermo, dove ti dice che i pacchetti sono mancanti.

1

Rimuovere la cartella "pacchetti" nella cartella del progetto. Cancellare i dati da queste cartelle:

'C: \ Users \% username% .nuget \ pacchetti' 'C: \ Users \% username% \ AppData \ Local \ NuGet \ v3-cache' 'C: \ Utenti \% userName% \ AppData \ Local \ dnu \ cache '

Quindi aprire la soluzione e fare clic con il pulsante destro del mouse sulla struttura della soluzione e fare clic su "Ripristina pacchetti NuGet".

1

Ho ricevuto questo errore solo ora da un'altra causa sciocca: mi piacerebbe a corto di spazio su disco! Se queste soluzioni non funzionano per te, è un'altra cosa da controllare.

Problemi correlati