Visual Studio/C#:Nuget 无法连接到远程服务器

Visual Studio/C#:Nuget 无法连接到远程服务器

问题描述:

在 MS Visual Studio 中,我尝试将 Nuget 包安装到我的解决方案中.

In MS Visual studio, I'm trying to install Nuget packages into my solution.

当我选择管理 Nuget 解决方案包"选项并尝试安装包时,我收到消息无法连接到远程服务器".

When I choose the option "Manage Nuget Packages for Solution" and attempt to install a package, I get the message "Unable to connect to the remote server".

我确实有互联网连接,所以不明白为什么我总是收到这条消息.

I do have Internet connection so do not understand why I always get this message.

有人知道可以采取哪些措施来纠正这个问题吗?

Is anyone aware of some steps that can be taken to rectify this issue?

谢谢

清除 HTTP_PROXY 对我有用.

Clearing HTTP_PROXY worked for me.

让我自己解决

重要提示:此部分、方法或任务包含的步骤会告诉您如何修改注册表.但是,如果不这样做,可能会出现严重的问题您错误地修改了注册表.因此,请确保您请仔细执行这些步骤.为了增加保护,请备份在修改注册表之前.然后,如果出现以下情况,您可以恢复注册表出现问题.有关如何备份和恢复的更多信息注册表,点击以下文章编号查看文章在 Microsoft 知识库中:322756 如何备份和恢复Windows 中的注册表

Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: 322756 How to back up and restore the registry in Windows

要自己重置您的 Internet Explorer 代理设置,请按照以下步骤操作步骤:

To reset your Internet Explorer proxy settings yourself, follow these steps:

  1. 在 Windows XP 上,单击开始,或者在 Windows Vista 或 Windows 7 上,单击,然后单击运行.在 Windows 8 或 Windows 8.1 上,访问运行命令,按 Windows 徽标键 Windows 徽标键 + R.或者,轻扫从屏幕的右边缘进入,然后点击搜索(或者如果您正在使用鼠标,指向屏幕的右上角,向下移动鼠标指针,然后单击搜索).输入运行搜索框,然后点击或单击运行".
  2. 在运行文本框中,复制 (CTRL+C) 并粘贴 (CTRL+V) 或键入以下:注册添加HKCU\Software\Microsoft\Windows\CurrentVersion\Internet 设置"/v 代理启用/t REG_DWORD/d 0/f
  3. 点击确定.
  4. 在 Windows XP 上,单击开始 ,或者在 Windows Vista 或 Windows 7 上,单击,然后单击运行.在 Windows 8 或 Windows 8.1 上,访问运行命令,按 Windows 徽标键 Windows 徽标键 + R.或者,轻扫从屏幕的右边缘进入,然后点击搜索(或者如果您正在使用鼠标,指向屏幕的右上角,向下移动鼠标指针,然后单击搜索).输入运行搜索框,然后点击或单击运行".
  5. 在运行文本框中,复制 (CTRL+C) 并粘贴 (CTRL+V) 或键入以下内容:reg deleteHKCU\Software\Microsoft\Windows\CurrentVersion\Internet 设置"/v 代理服务器/f
  6. 点击确定.

来自 http://support.microsoft.com/kb/2289942 谢谢@Sandy

From http://support.microsoft.com/kb/2289942 Thanks @Sandy