微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

c# – 无法安装nuget包unity 2

我需要将我的应用程序从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检查为包源.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐