在尝试连接到Nuget时,我得到了下面的错误,然后我无法连接:
无法加载源的服务索引 https://api.nuget.org/v3/index.json。 发送请求时发生错误。 无法连接到远程服务器 连接尝试失败,原因是被连接方在一段时间后没有正确响应,或已建立连接 由于连接的主机未能响应68.232.34.200:443而失败
我可以在浏览器上访问https://api.nuget.org/v3/index.json。
在尝试连接到Nuget时,我得到了下面的错误,然后我无法连接:
无法加载源的服务索引 https://api.nuget.org/v3/index.json。 发送请求时发生错误。 无法连接到远程服务器 连接尝试失败,原因是被连接方在一段时间后没有正确响应,或已建立连接 由于连接的主机未能响应68.232.34.200:443而失败
我可以在浏览器上访问https://api.nuget.org/v3/index.json。
当前回答
当我试图浏览NuGet包时,我得到了同样的错误,以解决以下相同的步骤:
1-转到%appdata%\NuGet\NuGet.config
2-验证该配置中提到的url
3-删除不需要的url
4-重新启动visual studio并检查
其他回答
你需要在Nuget中添加代理设置。配置文件。有关详细信息,请参阅此链接:Nuget配置部分和Nuget代理设置。
我有一对Windows 2016服务器,其中Visual Studio无法连接到NuGet。在尝试了几乎所有其他建议的修复(注册表更改,Visual Studio/NuGet相关的缓存清理或文件/配置更改)后,以下是我们解决它的方法。
我们有一个组策略(GPO),设置了密码,我将这些密码添加到我们的GPO密码列表中,以使其工作。
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
https://github.com/NuGet/Announcements/issues/60
为了支持@Eddie Chen提供的答案(这里),我不得不将http_proxy设置添加到以下文件中:
C: \ Windows \ system32 \漫游配置systemprofile \ AppData \ \鸡块鸡块。配置
<add key="http_proxy" value="http://your_proxy_url:8080" />
删除% AppData % \ \ NuGet \ NuGet徘徊。配置和重新启动VS2019对我来说很有效。
类似于https://github.com/NuGet/Home/issues/3281
我花了一天的时间,试遍了这里的一切。 对我来说,我没有在Visual Studio中更新我的密码!
I had changed my work Microsoft account password last week or so, I also use that account to login to visual studio, however I wasn't prompted to update it and was not logged out of Visual Studio, it remained logged in. When I clicked on my initials in the top right of visual studio > Account settings > under All Accounts the work account had yellow exclamation triangle warning sign next to it, updated the new password, then updated some packages, dotnet restore, cleaned & rebuilt and the errors are gone.