使用的NuGet包管理器控制台时无法访问来源 [英] Source unreachable when using the NuGet Package Manager Console
问题描述
我们是从手动更新文件的NuGet将我们的包管理。我试图安装旧版本的软件包来匹配一个我们已经在源代码控制。有没有办法让我用命令行来获得正确的版本从用户界面做到这一点。
We are moving our package management from manually updating files to NuGet. I am trying to install older versions of packages to match the one we already have in source control. There is no way to do this from the UI so I use the command line to get the proper version.
由于某些原因,安装封装上告诉我,画廊的NuGet不可达
保存。
在nuget.org [ https://www.nuget.org/api/v2/]源一>不可达。落回的NuGet本地缓存
The source at nuget.org [https://www.nuget.org/api/v2/] is unreachable. Falling back to NuGet Local Cache
这仅发生在我们的解决方案之一。如果我创建一个新的解决方案,或使用同一个版本库一个又一个,包将安装预期。我甚至可以安装包在一个虚设溶液以填充本地高速缓存,然后在有故障的溶液成功安装。我试图调用-的WebRequest
从控制台的NuGet的网址,我得到一个HTTP 200。
This happens only in one of our solutions. If I create a new solution or use another one in the same repository, packages will install as expected. I can even install the packages in a dummy solution to fill the local cache and then install them successfully in the faulty solution. I have tried to Invoke-WebRequest
on the url from the NuGet Console and I get an HTTP 200.
这是什么原因?有没有办法覆盖在每个解决方案/项目的基础包的来源?
What can cause this? Is there a way to override the package sources on a per solution/project basis?
推荐答案
虽然我的包源的设置在程序包管理器控制台nuget.org,明确加入 - 来源nuget.org
参数固定的这对我来说。
Even though my Package Source was set to nuget.org in Package Manager Console, explicitly adding the -Source nuget.org
argument fixed this for me.
所以使用的一个例子是:
So an example of use would be:
安装封装Akka.net -Source nuget.org
Akka.net是要安装包,它只是一个例子在这里。
Akka.net being your package that you want to install, its just an example here.
这篇关于使用的NuGet包管理器控制台时无法访问来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!