.Net Core 项目 Nuget Packages 无法恢复 [英] .Net Core project Nuget Packages Can not restore

查看:19
本文介绍了.Net Core 项目 Nuget Packages 无法恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想恢复我的 Identity Server 4 项目,在打开 VS2017 之后,但是当包管理器尝试恢复引用时,每次都会出现失败错误.

我使用最新版本的 VS2017 并且我的核心软件包已安装并更新在我的电脑上.

错误提要'nuget.org [

解决方案

根据错误日志中的信息:

<块引用>

找不到中央目录记录的结尾

您可以尝试以下故障排除步骤来解决此问题:

  • 通过以下命令清理整个 NuGet 包缓存:

    nuget locals all -clear

  • 关闭所有Visual Studio实例,删除该位置的nuget.config文件:

    C:UsersleoliuAppDataRoamingNuGetNuGet.Config

    然后重新打开 Visual Studio 以恢复 NuGet 包.

  • 检查是否有阻止 NuGet 安装包的防火墙策略或其他代理设置.

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

解决方案

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:UsersleoliuAppDataRoamingNuGetNuGet.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.

这篇关于.Net Core 项目 Nuget Packages 无法恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆