在尝试连接到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。
当前回答
删除% AppData % \ \ NuGet \ NuGet徘徊。配置和重新启动VS2019对我来说很有效。
类似于https://github.com/NuGet/Home/issues/3281
其他回答
在我的例子中,我只是重新启动docker并工作。
我试图添加一个Azure Artifacts NuGet源。
在这里,我遵循了微软的指示,但有一个关键的疏忽。
我忘记替换/v3/index了。Json和/v2。
我花了一天的时间,试遍了这里的一切。 对我来说,我没有在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.
当我试图在本地托管的Gitlab实例中设置NuGet包时遇到了这个错误。错误提示401未经授权的代码。解决方案是用以下方法去除有害源:
nuget source Remove -Name SOURCE_NAME
然后添加相同的源,但这次在命令中指定用户名和密码:
nuget source Add -Name SOURCE_NAME -Source SOURCE_URL -UserName GITLAB_DEPLOY_TOKEN_USERNAME -Password GITLAB_DEPLOY_TOKEN
该错误可能是由临时网络问题引起的,如果重试,该错误将消失。