简体   繁体   English

无法恢复 nuget package vs 2019

[英]Failed to restore nuget package vs 2019

I have started project in dotnet 5 and visual studio 2022 and now try to open it on visual studio 2019 in other pc.我已经在 dotnet 5 和 Visual Studio 2022 中启动了项目,现在尝试在其他电脑的 Visual Studio 2019 上打开它。 But I get error when I want to restore packages.但是当我想恢复软件包时出现错误。

Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/system.xml.xmlserializer/index.json'.
The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.xml.xmlserializer/index.json' has timed out after 100000ms.
Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/system.net.nameresolution/index.json'.
The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.net.nameresolution/index.json' has timed out after 100000ms.
Failed to download package 'SkiaSharp.2.80.1' from 'https://api.nuget.org/v3-flatcontainer/skiasharp/2.80.1/skiasharp.2.80.1.nupkg'.
The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/skiasharp/2.80.1/skiasharp.2.80.1.nupkg' has timed out after 100000ms.
Failed to download package 'Aspose.Cells.22.8.0' from 'https://api.nuget.org/v3-flatcontainer/aspose.cells/22.8.0/aspose.cells.22.8.0.nupkg'.
Cannot access a disposed object.

Any idea please?请问有什么想法吗?

In many cases when coping solution from one computer to another or especially if Visual Studio version is changed, errors occur that prevent automatic packages restoring and their dependencies.在许多情况下,当将解决方案从一台计算机处理到另一台计算机时,尤其是在更改 Visual Studio 版本时,会发生错误,从而阻止自动包还原及其依赖项。 Therefore, to be able restore required packages try the following:因此,为了能够恢复所需的包,请尝试以下操作:

  1. Open developer command prompt for Visual Studio.打开 Visual Studio 的开发人员命令提示符。
  2. Go to your solution directory and run dotnet restore . Go 到您的解决方案目录并运行dotnet restore

Sometimes it's enough to remove and reinstall the required package from Visual Studio using the NuGet Package Manager .有时,使用NuGet Package Manager从 Visual Studio 删除并重新安装所需的 package 就足够了。

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

相关问题 无法恢复 NuGet package 访问被拒绝 - Failed to restore NuGet package Access denied 在没有VS的情况下通过安装包内容来还原Nuget - Nuget restore without VS with package content installation “启用NuGet包恢复”在VS 2015中消失了 - “Enable NuGet Package Restore” is gone in VS 2015 干净的VS 2015 Enterprise + Xamarin安装:错误:项目的NuGet包还原失败 - clean VS 2015 Enterprise + Xamarin Install: error: NuGet Package restore failed for project VS 2015:C# NuGet 包还原失败。 文件或目录已损坏且无法读取 - VS 2015: C# NuGet Package restore failed. The file or directory is corrupted and unreadable VS2013中的项目杂项文件的NuGet包还原失败:值不能为null或空字符串。在VS2013中 - NuGet Package restore failed for project Miscellaneous Files: Value cannot be null or an empty string.in VS2013 Nuget Package Manager 在 VS2019 中不显示 package 信息 - Nuget Package Manager not displaying package info in VS2019 如何解决 Visual Studio 中的“NuGet package 还原失败”? - How to resolve "NuGet package restore failed" in Visual Studio? 找不到后备 package 文件夹“NuGet & VS2019”错误 - Unable to find fallback package folder "NuGet & VS2019" Error VS2019 + Dotnet Framework 4.7.2中Nuget包安装问题 - Nuget package installation issue in VS2019 + Dotnet Framework 4.7.2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM