【发布时间】:2018-07-26 10:21:53
【问题描述】:
我在 Visual Studio 包管理器输出中得到的错误是:
[nuget.org] Unable to load the service index for source https://www.nuget.org/api/v2.
An error occurred while sending the request.
The remote server returned an error: (405) Method Not Allowed.
在NuGet.config中配置代理或者不配置代理对结果没有影响。
nuget.org 在我的配置中是:
<add key="nuget.org" value="https://www.nuget.org/api/v2" />
如果我将环境 http_proxy 设置为我的公司代理,我可以使用 nuget.exe (NuGet Version: 4.7.0.5148) 重现它
nuget list -source nuget.org -ForceEnglishOutput
Unable to load the service index for source https://www.nuget.org/api/v2.
An error occurred while sending the request.
The remote server returned an error: (405) Method Not Allowed.
如果我清除环境 http_proxy 相同的命令开始列出包。 (我使用crtl+c 中止)。
我知道visual studio中的包管理器和nuget.exe是有区别的。
据我了解,两者都使用相同的 nuget.config 文件。 正如我所看到的,包管理器以某种方式使用了我没有检查的代理设置。我找不到那个地方。
是否有我没有检查的代理设置? 我还缺少其他东西吗?
编辑: 当我从 Nuget.Config 中删除代理设置,然后在 Visual Studio 中更新包源时,我的 Nuget.Config 设置被重写,从而恢复了我的代理设置。
【问题讨论】:
标签: visual-studio proxy nuget nuget-package http-proxy