Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.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
C# 如何解决尝试浏览新引用时出现的NuGet错误_C#_Visual Studio_Nuget - Fatal编程技术网

C# 如何解决尝试浏览新引用时出现的NuGet错误

C# 如何解决尝试浏览新引用时出现的NuGet错误,c#,visual-studio,nuget,C#,Visual Studio,Nuget,在Visual studio 2015中尝试浏览来自Nuget package manager的引用时,我遇到以下错误: [nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json. An error occurred while sending the request. The underlying connection was closed: An unexpecte

在Visual studio 2015中尝试浏览来自Nuget package manager的引用时,我遇到以下错误:

[nuget.org] Unable to load the service index for source 
https://api.nuget.org/v3/index.json. An error occurred while sending the request.
The underlying connection was closed: An unexpected error occurred on a send.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host

最近我更新了我的VS2015,在更新之前,我遇到了这个错误。在添加引用时,我没有收到任何错误。 我根据这个问题找到了一些答案并尝试了一下

  • 我已卸载Nuget并重新安装
  • 已删除NuGet.config文件
  • 但我的问题并没有得到解决,最后我卸载了VS2015并重新安装,但我仍然面临同样的错误。
    有谁能解决我的问题吗?

    由于您无法直接从办公系统在浏览器中打开url,您的办公环境中应该存在一些internet限制。我建议您联系您的IT办公室,确认他们是否添加了任何限制,是否使用了任何代理。如果他们使用某些代理,则需要在存储在C:\Users\user name\AppData\Roaming\NuGet中的NuGet.Config文件中设置代理设置,如下所示。详细信息请参阅中的“代理设置”部分

    
    
    我已将包源代码更改为“https”://api.nuget.org/v3/index.json更改为“http”://api.nuget.org/v3/index.json然后我可以看到引用,但在尝试安装时无法安装它们,显示错误从源“nuget”检索“Selenium.WebDriver.2.53.1”的包元数据时出错。根据错误消息,此问题似乎是由网络访问nuget.org引起的。您可以尝试从浏览器访问url,以检查是否可以直接从浏览器访问该url。在我的办公系统中,我直接在浏览器中检查了url,结果显示无法访问此网站,但在我的个人计算机中尝试了相同的url。我没有收到任何错误,而且我已从我的pc(而不是从计算机)在VS2015中安装了nuget软件包办公系统。
    <add key="http_proxy" value="host" />
    <add key="http_proxy.user" value="username" />
    <add key="http_proxy.password" value="encrypted_password" />