Asp.net-core – .Net Core project Nuget Packages Can not restore

asp.net-corenugetvisual-studio-2017

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'.

enter image description here

Best Answer

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:

  • Clean the entire NuGet package cache by the command:
    nuget locals all -clear
    
  • Close all Visual Studio instances, delete the nuget.config file in the location:
    C:\Users\leoliu\AppData\Roaming\NuGet\NuGet.Config
    
    and then reopen Visual Studio to restore NuGet packages.
  • Check if there is a firewall policy or other proxy settings that is blocking the NuGet installation package.
Related Topic