在公司代理后面访问 Nuget 官方包源 [英] Accessing Nuget Official Package Source behind company proxy

查看:28
本文介绍了在公司代理后面访问 Nuget 官方包源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 VS2010 中使用 Nuget.当我尝试从官方提要下载软件包时,它总是以 403 失败.

I am trying to use Nuget in VS2010 at work. When I try and download packages from the official feed it always fails with a 403.

我了解到 Nuget 将使用与 IE 相同的代理设置,这对我来说很不幸,因为我的 IE 被锁定了.我无法更改代理.

I've read that Nuget will use the same proxy settings as IE, which is unfortunate for me as my IE is locked down. I can't change the proxy.

我修改了被退回的 feedservice url,在 IE 中出现错误,在 Firefox(定义了本地 proxy.pac)中,url 解析得很好,我可以看到提要.

I have fiddled the feedservice urls that are getting bounced, in IE I get an error, in Firefox (with a local proxy.pac defined) the urls resolve fine and I can see the feeds.

有没有办法手动配置 Nuget 不使用 IE 的设置?

Is there any way to manually configure Nuget not to use IE's settings?

推荐答案

如果您无法将异常添加到您的代理中,或者只是想要一个即时解决方案,那么请编辑您的 Visual Studio 配置文件 (devenv.exe.config)位于您的 Visual Studio 安装目录(例如 - C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE)并更改/添加 配置部分到以下内容,这将使 Visual Studio 与代理一起工作:

If you can't get the exception added to your proxy, or just want an immediate solution then edit your Visual studio configuration file (devenv.exe.config) located in your Visual Studio installation directory (eg - C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE) and change/add the <system.net> configuration section to the following, which will let Visual Studio work with the proxy:

<system.net>
    <defaultProxy useDefaultCredentials="true" enabled="true">
        <proxy proxyaddress="http://<Insert proxy address here>" />
    </defaultProxy>
    <settings>
        <servicePointManager expect100Continue="false" />
        <ipv6 enabled="true" />
    </settings>
</system.net>

您需要做的就是将<在此处插入代理地址>更改为您公司的代理地址.此外,根据您的代理设置,您可以使用 Expect100Continue 消息,并且可能不需要更改该配置元素.您可以在此处

All you need to do is change the <Insert proxy address here> to your company's proxy address. Also depending on your proxy settings you may be able to use Expect100Continue messages and may not need to change that configuration element. You can find more information here

这篇关于在公司代理后面访问 Nuget 官方包源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆