在尝试连接到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。
当前回答
你的一个金块来源可能无法到达。
在撰写本文时,AspNetCore (https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json)似乎有一个过期的证书或已被完全删除。
只需从设置中删除nuget源就可以解决这个问题
其他回答
nuget restore
and
msbuild /t:restore
两者都没有为我工作,因为同样的错误。但
dotnet restore
完美的工作。试试
去
设置(PC全局设置)>网络和Internet >代理>自动代理设置>和“自动检测设置”设置为“关闭”。
如果您看到如下错误,您可能需要设置Azure Artifacts凭据,请参阅Github链接,您可以通过运行powershell脚本或手动安装凭据提供程序。
error : Response status code does not indicate success: 401 (Unauthorized).
I had the same error message while scaffolding Identity to my ASP.NET Core MVC project. Since my connection was not behind a proxy, removing/editing proxy configurations didn't make sense. And I didn't want to delete a file or uninstall PMC either. While looking around I realized a "Clear All Nuget Cache(s)" button on Tools --> Options --> NuGet Package Manager --> General. After pressing the button I had to wait for some time for the operation to complete. After that I tried to scaffold the Identity again but it didn't work. Then I decided to restart VS and voila :)
在我的例子中,我只是重新启动docker并工作。