的NuGet代理的背后 [英] NuGet Behind Proxy
问题描述
我弄清楚,允许的NuGet自1.4版本的代理服务器设置的配置。但是,我找不到任何命令行的例子。
I figure out that NuGet allows proxy settings configuration since 1.4 version. But, I can't find any command line example.
我试图运行一些构建和的NuGet无法连接。
I'm trying to run some build and NuGet can't connect.
如何在命令行配置代理服务器设置?
How to configure the proxy settings in the command line?
推荐答案
下面是我所做获得与使用NTLM身份验证我公司代理的这方面的工作。我下载的 NuGet.exe ,然后运行下面的命令(我在评论中发现上codePLEX这个讨论):
Here's what I did to get this working with my corporate proxy that uses NTLM authentication. I downloaded NuGet.exe and then ran the following commands (which I found in the comments to this discussion on CodePlex):
nuget.exe config -set http_proxy=http://my.proxy.address:port
nuget.exe config -set http_proxy.user=mydomain\myUserName
nuget.exe config -set http_proxy.password=mySuperSecretPassword
这把我的 NuGet.config
位于%APPDATA%\\的NuGet
(映射到<以下EM> C:\\用户\\ MyUserName输入\\应用程序数据\\漫游我的Windows 7机器上的EM>)
This put the following in my NuGet.config
located at %appdata%\NuGet
(which maps to C:\Users\myUserName\AppData\Roaming on my Windows 7 machine):
<configuration>
<!-- stuff -->
<config>
<add key="http_proxy" value="http://my.proxy.address:port" />
<add key="http_proxy.user" value="mydomain\myUserName" />
<add key="http_proxy.password" value="base64encodedHopefullyEncryptedPassword" />
</config>
<!-- stuff -->
</configuration>
顺便说一句,这也是固定我的问题与只的NuGet工作,我第一次打了包源在Visual Studio中。
Incidentally, this also fixed my issue with NuGet only working the first time I hit the package source in Visual Studio.
的需要注意的是一些人谁曾尝试这种方法已经通过的意见,他们已经能够省略设置在命令行中的 http_proxy.password
键报道,或者将其删除后的,其实从配置文件,并且仍然能够有跨代理的NuGet功能。的
Note that some people who have tried this approach have reported through the comments that they have been able to omit setting the
http_proxy.password
key from the command line, or delete it after-the-fact from the config file, and were still able to have NuGet function across the proxy.
如果你发现,但是,你的必须的指定中的NuGet配置文件密码,请记住,你有你的时候通过命令行更新了的NuGet配置存储的密码改变你的网络登录,如果你的代理凭据也是您的网络凭据
If you find, however, that you must specify your password in the NuGet config file, remember that you have to update the stored password in the NuGet config from the command line when you change your network login, if your proxy credentials are also your network credentials.
这篇关于的NuGet代理的背后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!