gpt4 book ai didi

c# - 无法安装 nuget 包 unity 2

转载 作者:行者123 更新时间:2023-11-30 12:45:48 26 4
gpt4 key购买 nike

我需要将我的应用程序从 4.5 降级到 3.5,并且我安装了 unity 3。现在我无法从 nuget 安装 unity 2.1,因为这个错误:

PM> Install-Package Unity -Version 2.1.505.2
The source at nuget.org [https://www.nuget.org/api/v2/] is unreachable. Falling back to NuGet Local Cache at C:\Users\voskresenskiy\AppData\Local\NuGet\Cache
Install-Package : Unable to find version '2.1.505.2' of package 'Unity'.
At line:1 char:16
+ Install-Package <<<< Unity -Version 2.1.505.2
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

我做错了什么?我将不胜感激

最佳答案

您的互联网连接似乎已断开或 Nuget Org 暂时无法访问,并且所需的 Unity 版本在缓存中不可用。

看看this :

Though NuGet packages are typically consumed from a remote gallery such as the NuGet gallery using a network connection, there are many scenarios where the client is not connected. Without a network connection, the NuGet client was not able to successfully install packages - even when those packages were already on the client's machine in the local NuGet cache. NuGet 2.8 adds automatic cache fallback to the package manager console. For example, when disconnecting the network adapter and installing jQuery, the console shows the following:

PM> Install-Package jquery The source at nuget.org [https://www.nuget.org/api/v2/] is unreachable. Falling back to NuGet Local Cache at C:\Users\me\AppData\Local\NuGet\Cache Installing 'jQuery 2.0.3'. Successfully installed 'jQuery 2.0.3'. Adding 'jQuery 2.0.3' to WebApplication18. Successfully added 'jQuery 2.0.3' to WebApplication18.

编辑:

测试相同的命令后,我可以确认它工作正常,使用相同的版本我可以使用 nuget 安装它,检查 nuget 的设置并确保 nuget.org 被检查为包源。

关于c# - 无法安装 nuget 包 unity 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22781079/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com