Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.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
Visual studio 2010 NuGet在通过Visual Studio下载包时使用哪个端口_Visual Studio 2010_Nuget_Nuget Package - Fatal编程技术网

Visual studio 2010 NuGet在通过Visual Studio下载包时使用哪个端口

Visual studio 2010 NuGet在通过Visual Studio下载包时使用哪个端口,visual-studio-2010,nuget,nuget-package,Visual Studio 2010,Nuget,Nuget Package,我正在使用VS2010(PackageManager控制台)下载NuGet(2.5.40416.9020/最新版本)软件包。它使用URL。它给我的错误如下 Install-Package : An error occurred while loading packages from'https://nuget.org/api/v2/': The remote name could not be resolved: 'nuget.org' At line:1 char:16 + Install-P

我正在使用VS2010(PackageManager控制台)下载NuGet(2.5.40416.9020/最新版本)软件包。它使用URL。它给我的错误如下

Install-Package : An error occurred while loading packages from'https://nuget.org/api/v2/': The remote name could not be resolved: 'nuget.org'
At line:1 char:16
+ Install-Package <<<<  Rx-Main
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
安装程序包:从加载程序包时出错'https://nuget.org/api/v2/“:无法解析远程名称:'nuget.org'
第1行字符:16

+安装软件包
https://nuget.org/api/v2/
表示端口443(HTTPS的标准端口)

如果您在公司网络上,端口80和443通常通过代理服务器跳转


很可能由于某种原因,NuGet没有使用您的代理设置,因此它找不到代理服务器,并被公司防火墙阻止。

转到文件程序文件\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.config

Set ipv6 enabled from true to false


我无法通过控制台下载nugget软件包,它给出了如下错误:

“无法连接远程服务器”

我按照上述步骤将ipv6启用设置为true到false。它解决了我的问题

C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config

<system.net>
     <settings>
         <ipv6 enabled="false"/>
     </settings>
</system.net>
C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config

在我的例子中,在Nuget.Config文件(\users*\appdata\Roaming\Nuget\Nuget.Config)中手动添加包源引用(用于获取包的URL)解决了问题

确保您在解决方案中引用的所有nuget包都已添加到上面的nuget.Config文件中


由于某种原因,引用从我的配置文件中被删除,我开始得到这个异常。将它们手动添加到配置文件中解决了我的问题。

但443在防火墙上没有被阻止,我可以浏览该站点,但当我通过Package Manager控制台运行命令时,会出现错误。@vijay我相当确定您使用的浏览器有一个代理集,NuGet没有自动选择这些设置。这里有一个关于如何为NuGet 1.4或更高版本设置代理设置的示例。感谢@Joachim的回复。我已经设置了代理地址。但现在我有了新的错误
远程服务器返回了一个错误:(502)坏网关
@vijay听起来仍然有问题。可能您已经将HTTP代理配置为HTTPS或相反,或者代理不支持NuGet所需的所有代理命令。感谢@Joachim,现在已解决此问题。我还更新了visual studio配置的代理设置,并已开始工作。:)再次感谢。4小时后。谢谢你的发帖!我的问题是,公司代理设置是通过我在解决方案中使用的NuGet.config文件添加到此文件的。我猜它使用了这些代理设置并更新了我个人资料下的设置。看来,将其备份的唯一方法是手动编辑此文件。此设置阻止我从公司内部源获取软件包。如果我找不到devenv.exe.config文件怎么办?
C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config

<system.net>
     <settings>
         <ipv6 enabled="false"/>
     </settings>
</system.net>