“No se pudo encontrar el registro del final del Directorio Central” – NuGet en la comunidad VS 2015

Recibo un error cuando bash instalar cualquier paquete de NuGet en la edición de la comunidad 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.<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.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.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.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.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.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.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.d__42.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at NuGet.PackageManagement.NuGetPackageManager.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.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.d__3.MoveNext() ========== Finished ========== 

El mensaje de error que recibo está en la pestaña Lista de errores es

 End of Central Directory record could not be found 

Probé desde la aplicación de la Consola a las bibliotecas de clases y obtuve este error para todos los paquetes que intenté instalar.

La versión de NuGet es: 3.0.60624.657

Cualquier ayuda será apreciada.

Vaya a su carpeta de soluciones y elimine su carpeta de “paquetes”. Tendrá que hacer clic con el botón derecho en su solución, seleccionar “Administrar paquetes” y hacer clic en el botón “Restaurar” en la parte superior de la pantalla donde le indica que faltan paquetes.

Elimine la carpeta ‘paquetes’ en su carpeta de proyecto. Borre los datos de estas carpetas:

%USERPROFILE%\.nuget\packages

%USERPROFILE%\AppData\Local\NuGet\v3-cache

%USERPROFILE%\AppData\Local\dnu\cache

Luego abra la solución, haga clic con el botón derecho en el árbol de la solución y haga clic en “Restaurar paquetes NuGet”.

Recibí este error ahora mismo por otra causa tonta: ¡Me quedé sin espacio en el disco! Si estas soluciones no están funcionando para usted, eso es otra cosa que debe verificar.

Intenta a continuación:

 D:\src\build>nuget locals -clear all Clearing NuGet HTTP cache: C:\Users\dzmitry\AppData\Local\NuGet\v3-cache Clearing NuGet cache: C:\Users\dzmitry\AppData\Local\NuGet\Cache Clearing NuGet global packages cache: C:\Users\dzmitry\.nuget\packages\ WARNING: Local resources partially cleared. WARNING: Failed to delete 'C:\Users\dzmitry\.nuget\packages\'. WARNING: Failed to delete 'C:\Users\dzmitry\.nuget\packages\fsharp.data.xmlprovider\2.3.14159\lib\net40\FSharp.Data.DesignTime.dll'. Clearing local resources failed: one or more errors occured.