简体   繁体   English

无法安装nuget package unity 2

[英]Cannot install nuget package unity 2

I need to downgrade my app from 4.5 to 3.5 and i had unity 3 installed. 我需要将我的应用程序从4.5降级到3.5并且我安装了unity 3。 Now i cannot install unity 2.1 from nuget, because of this error: 现在我无法从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

What am i doing wrong? 我究竟做错了什么? I'll be gratefull for any help 我会感激任何帮助

It seems your internet connection ist down or the Nuget Org is temporary not reachable, and the desired version of Unity is not avilable in the cache. 看起来您的互联网连接已关闭或Nuget Org暂时无法访问,并且所需的Unity版本在缓存中无法使用。

Take alook at 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. 虽然NuGet包通常使用网络连接从诸如NuGet库之类的远程库中使用,但是在许多情况下客户端未连接。 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客户端无法成功安装软件包 - 即使这些软件包已经在本地NuGet缓存中的客户端计算机上。 NuGet 2.8 adds automatic cache fallback to the package manager console. NuGet 2.8将自动缓存回退添加到包管理器控制台。 For example, when disconnecting the network adapter and installing jQuery, the console shows the following: 例如,在断开网络适配器并安装jQuery时,控制台显示以下内容:

PM> Install-Package jquery The source at nuget.org [https://www.nuget.org/api/v2/] is unreachable. PM> Install-Package jquery nuget.org [https://www.nuget.org/api/v2/]上的源无法访问。 Falling back to NuGet Local Cache at C:\\Users\\me\\AppData\\Local\\NuGet\\Cache Installing 'jQuery 2.0.3'. 回到C:\\ Users \\ me \\ AppData \\ Local \\ NuGet \\ Cache的NuGet Local Cache安装'jQuery 2.0.3'。 Successfully installed 'jQuery 2.0.3'. 成功安装了'jQuery 2.0.3'。 Adding 'jQuery 2.0.3' to WebApplication18. 将“jQuery 2.0.3”添加到WebApplication18。 Successfully added 'jQuery 2.0.3' to WebApplication18. 成功将“jQuery 2.0.3”添加到WebApplication18。

EDIT: 编辑:

After testing the same command i can confirm it works fine, using the same version i could install it using nuget, check the settings of nuget and ensure the nuget.org is check as package source. 在测试相同的命令后,我可以确认它工作正常,使用相同的版本,我可以使用nuget安装它,检查nuget的设置,并确保nuget.org检查为包源。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM