Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
由于api.nuget.org/v3/index.json,Dotnet还原失败_Nuget_Dotnet Restore - Fatal编程技术网

由于api.nuget.org/v3/index.json,Dotnet还原失败

由于api.nuget.org/v3/index.json,Dotnet还原失败,nuget,dotnet-restore,Nuget,Dotnet Restore,我有一个.NET Core 2.1应用程序,无法再运行dotnet restore。 我得到这个错误: 正在还原的包 D:\Work-2\Anubis\Core\AnubisServer.Server\AnubisServer. 服务器.csproj。。。恢复在22.22毫秒内完成 D:\Work-2\Anubis\Core\COM\SharedCOM\SharedCO M.csproj。恢复在26.09毫秒内完成 D:\Work-2\Anubis\Core\AnubisServer.Share

我有一个
.NET Core 2.1
应用程序,无法再运行
dotnet restore

我得到这个错误:

正在还原的包 D:\Work-2\Anubis\Core\AnubisServer.Server\AnubisServer.
服务器.csproj。。。恢复在22.22毫秒内完成 D:\Work-2\Anubis\Core\COM\SharedCOM\SharedCO
M.csproj。恢复在26.09毫秒内完成 D:\Work-2\Anubis\Core\AnubisServer.Shared\An
ubisServer.Shared.csproj。恢复在26.07毫秒内完成 D:\Work-2\Anubis\Core\Server\Extensions\Exte
S.csproj。恢复在26.12毫秒内完成 D:\Work-2\Anubis\Core\AnubisServer.Client\An
ubisServer.Client.csproj。C:\程序 Files\dotnet\sdk\3.0.100-preview-009812\NuGet.targets(114,5):错误: 无法加载源的服务索引
. [D:\Work-2\Anubis\Core\AnubisServer.Server\AnubisServer.Server.csproj] C:\程序 Files\dotnet\sdk\3.0.100-preview-009812\NuGet.targets(114,5):错误: 无法建立SSL连接,请参阅内部异常。 [D:\Work-2\
Anubis\Core\AnubisServer.Server\AnubisServer.Server.csproj]C:\Program Files\dotnet\sdk\3.0.100-preview-009812\NuGet.targets(114,5):错误: 无法从传输连接读取数据:连接 尝试失败
d因为关联方在一段时间后没有作出适当回应 关于时间,o
r建立的连接失败,因为连接的主机无法连接 回应[
D:\Work-2\Anubis\Core\AnubisServer.Server\AnubisServer.Server.csproj] C:\程序 Files\dotnet\sdk\3.0.100-preview-009812\NuGet.targets(114,5):错误: 连接尝试失败,因为连接方未连接 正确响应
ond在一段时间后,或由于以下原因建立的连接失败 已连接h
ost未能响应。 [D:\Work-2\Anubis\Core\AnubisServer.Server\AnubisServ
er.Server.csproj]

正如你所看到的那样,这一切都是围绕着
api.nuget.org/v3/index.json解决的,但我不知道哪里出了问题

我看过以前的文章,并尝试:

-正在从C:/Users:/[username]/Nuget删除Nuget文件夹
-查看
C:\Users\[user]\AppData\Roaming\NuGet.config
文件,查看是否所有URL都正常

Nuget.config

   <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <packageSources>
        <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
      </packageSources>
    </configuration>


令我好奇的是,直到今天它仍然工作正常。我没有对系统进行任何更改。

如果您查看错误消息,您将看到:

错误:无法从传输连接读取数据:连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机没有响应

所以,正如你所看到的,NuGet在尝试与NuGet.org对话时遇到了网络问题。您可以尝试打开web浏览器,看看是否可以在那里打开。但是,仅仅因为它在浏览器中工作并不意味着它将从nuget.exe、devenv.exe(visual studio)、dotnet.exe等自动工作

发生这种情况的原因有很多,我不可能一一列举,但如果您使用的是工作计算机,可能是您的IT部门阻止了传出的web访问,并使用组策略强制您的web浏览器使用代理。也许他们配置了你电脑的防火墙,禁止所有程序使用网络,除了白名单上的程序(网络浏览器、邮件客户端、公司应用程序)

或者可能只是暂时的或局部的网络问题。nuget.org位于CDN后面,如果离您最近的CDN节点出现问题


对于想要联系NuGet.org了解站点关闭的人,CDN提供商需要这一点来诊断这些问题。我想指出的是,MTR是一个非常有用的工具,它可以帮助您诊断网站维护人员无法自行监控的网络问题。

如果您查看错误消息,您将看到:

错误:无法从传输连接读取数据:连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机没有响应

所以,正如你所看到的,NuGet在尝试与NuGet.org对话时遇到了网络问题。您可以尝试打开web浏览器,看看是否可以在那里打开。但是,仅仅因为它在浏览器中工作并不意味着它将从nuget.exe、devenv.exe(visual studio)、dotnet.exe等自动工作

发生这种情况的原因有很多,我不可能一一列举,但如果您使用的是工作计算机,可能是您的IT部门阻止了传出的web访问,并使用组策略强制您的web浏览器使用代理。也许他们配置了你电脑的防火墙,禁止所有程序使用网络,除了白名单上的程序(网络浏览器、邮件客户端、公司应用程序)

或者可能只是暂时的或局部的网络问题。nuget.org位于CDN后面,如果离您最近的CDN节点出现问题

对于想要联系NuGet.org了解站点关闭的人,CDN提供商需要这一点来诊断这些问题。我想指出的是,MTR是一个非常有用的工具,可以帮助您诊断网站维护人员无法自行监控的网络问题