简体   繁体   English

.Net Core项目Nuget软件包无法还原

[英].Net Core project Nuget Packages Can not restore

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. 我想在打开VS2017之后还原我的Identity Server 4项目,但是当程序包管理器尝试还原引用时,每次都会出现失败错误。

I use latest version of VS2017 and my core packages installed and updated on my pc. 我使用最新版本的VS2017,并且在我的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. 错误提要'nuget.org [ https://api.nuget.org/v3/index.json] '列出了程序包'Microsoft.AspNetCore.2.1.3',但是多次下载nupkg的尝试均失败了。 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. 确认Feed中存在该程序包,然后重试。 Unable to find package 'Microsoft.AspNetCore.2.1.3'. 找不到软件包“ Microsoft.AspNetCore.2.1.3”。

在此处输入图片说明

end of central directory record could not be found 找不到中央目录记录的末尾

According to the message in the error log "end of central directory record could not be found", you can try following troubleshootings to resolve this issue: 根据错误日志中的消息“找不到中央目录记录的结尾”,您可以尝试执行以下疑难解答来解决此问题:

  • Clean all the NuGet package cache by the command line: nuget locals all -clear . 通过命令行清除所有NuGet软件包缓存: nuget locals all -clear
  • Close all Visual Studio instance, then delete nuget.config file in the location: C:\\Users\\leoliu\\AppData\\Roaming\\NuGet\\NuGet.Config , then re-open the Visual Studio to restore nuget packages. 关闭所有Visual Studio实例,然后在以下位置删除nuget.config文件: C:\\Users\\leoliu\\AppData\\Roaming\\NuGet\\NuGet.Config ,然后重新打开Visual Studio以还原nuget包。
  • Check if there is a firewall policy or other proxy settings that block the nuget installation package. 检查是否存在阻止nuget安装软件包的防火墙策略或其他代理设置。

Hope this helps. 希望这可以帮助。

Did you try it by Manage NuGet Packages ? 您是否通过Manage NuGet Packages尝试过?

1) Remove IdentityServer4 from Dependencies 1)从依赖关系中删除IdentityServer4

2) Open Manage NuGet Packages 2)打开管理NuGet程序包

3) Browse IdentityServer4 again and install it 3)再次浏览IdentityServer4并安装

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您在哪个文件中为.NET Core项目设置nuget包? - In which file do you set nuget packages for a .NET Core project? 无法在空白的ASP.NET核心项目中添加nuget包 - unable to add nuget packages in blank ASP.NET core project Nuget无法更新.NET Core项目 - Nuget can't update .NET Core project .Net Core 2.0在dotnet还原期间警告NU1603,NuGet套件问题 - .Net Core 2.0 Warning NU1603 during dotnet restore, problems with NuGet packages 无法在ASP.NET核心应用程序中还原Bower软件包? - Can't restore Bower packages in ASP.NET core application? Nuget 还原在 VSO 2017 构建的 CORE 包上失败 - Nuget restore fails on VSO 2017 build for CORE packages 无法在 .net 核心中使用本地 nuget 包 - Unable to use local nuget packages in .net core 使用旧解决方案将nuget包添加到.net核心项目时如何修复$(NETStandardImplicitPackageVersion)错误? - How to fix $(NETStandardImplicitPackageVersion) error when adding nuget packages to .net core project with older solution? .NET Core c# 项目 - 所有 nuget 包都位于何处? - .NET Core c# Project - where does all nuget packages are located? ASP.Net Core-在项目中哪里可以找到Nuget软件包的安装列表 - ASP.Net Core - Where to find the Nuget packages installed list in the project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM