I want to restore my Identity Server 4 project, after open VS2017 but when package manager try to restore references, it gets fail error every time.
I use latest version of VS2017 and my core packages installed and updated on my pc.
Error The feed 'nuget.org [https://api.nuget.org/v3/index.json]' lists package 'Microsoft.AspNetCore.2.1.3' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again. Unable to find package 'Microsoft.AspNetCore.2.1.3'.
Restore packages manually using Visual Studio Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.
Quick solution for Visual Studio users Select the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.
The dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file. In most cases, you don't need to explicitly use the dotnet restore command, since a NuGet restore is run implicitly if necessary when you run the following commands: dotnet new.
It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. Here are some actions you can take to resolve this error: Add the /restore option to your MSBuild.exe command.
Restore using the nuget.exe CLI Use the restore command, which downloads and installs any packages missing from the packages folder. For projects migrated to PackageReference, use msbuild -t:restore to restore packages instead.
Try updating your Visual Studio to the lastest version, sometimes the updates helps you solve package issues which was previously not supported. Right-click on the Solution and click "Restore NuGet Packages" option. Or you can try executing this console command in the folder that has your solution file:
If the package isn't in the cache, NuGet tries to download the package from all enabled sources in the list at Tools > Options > NuGet Package Manager > Package Sources in Visual Studio. During restore, NuGet ignores the order of package sources, and uses the package from whichever source is first to respond to requests.
When you add a NuGet package to your project, NuGet essentially does two things: It downloads the package and puts it in your solution under a directory called “packages”. It installs the package to your project.
According to the message in the error log:
end of central directory record could not be found
You can try the following troubleshooting steps to resolve this issue:
nuget locals all -clear
nuget.config
file in the location:
C:\Users\leoliu\AppData\Roaming\NuGet\NuGet.Config
and then reopen Visual Studio to restore NuGet packages.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With