arc*_*ain 185
以下是我使用NTLM身份验证的公司代理所做的工作.我下载了NuGet.exe,然后运行了以下命令(我在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
Run Code Online (Sandbox Code Playgroud)
这将以下内容放在我的NuGet.config位置%appdata%\NuGet(在我的Windows 7机器上映射到C:\ Users\myUserName\AppData\Roaming):
<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>
Run Code Online (Sandbox Code Playgroud)
顺便说一句,这也解决了我的问题,NuGet只在我第一次点击Visual Studio中的包源时工作.
请注意,尝试过这种方法的一些人已通过评论报告他们已经能够省略
http_proxy.password从命令行设置密钥,或者从配置文件中删除它后仍然能够具有NuGet功能跨代理.
但是,如果您发现必须在NuGet配置文件中指定密码,请记住,如果您的代理凭据也是您的网络,则必须在更改网络登录时从命令行更新NuGet配置中存储的密码凭证.
Tx3*_*Tx3 22
也许你可以尝试这个你的devenv.exe.config
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy proxyaddress="http://proxyaddress" />
</defaultProxy>
<settings>
<servicePointManager expect100Continue="false" />
<ipv6 enabled="true"/>
</settings>
</system.net>
Run Code Online (Sandbox Code Playgroud)
关于NuGet +网络问题还有其他有价值的评论.
Rom*_*rer 10
如果您使用的是https版本的nuget(https://www.nuget.org),请注意您必须使用https设置值.
我可能错了,但我认为它使用了IE的代理设置.
如果它发现您需要登录它会打开一个对话框并要求您这样做(登录即可).
请在此处查看此处的说明 - > http://docs.nuget.org/docs/release-notes/nuget-1.5
小智 6
相同“nuget 代理”的另一种风格:或者,您可以将 nuget 代理设置设置为通过fiddler进行连接。下面的 cmd 会将代理设置保存在用户的默认 nuget 配置文件中%APPDATA%\NuGet\NuGet.Config
nuget config -Set HTTP_PROXY=http://127.0.0.1:8888
Run Code Online (Sandbox Code Playgroud)
每当您需要 nuget 访问互联网时,只需打开 Fiddler,假设您让 Fiddler 监听默认端口 8888。
此配置对密码更改不敏感,因为 fiddler 将为您解析任何与上游代理的身份验证。
对于使用VS2015的任何人:我遇到“需要407代理身份验证”错误,这破坏了我的构建。经过几个小时的调查,事实证明,MSBuild在尝试下载Nuget作为“ DownloadNuGet”目标的一部分时并未发送凭据。解决方案是将以下XML添加到<configuration>元素内部的C:\ Program Files(x86)\ MSBuild \ 14.0 \ Bin \ MSBuild.exe.config中:
<system.net>
<defaultProxy useDefaultCredentials="true">
</defaultProxy>
</system.net>
Run Code Online (Sandbox Code Playgroud)
小智 5
我的解决方案是包括
<configuration>
<config>
<add key="http_proxy" value="http://<IP>:<Port>" />
<add key="http_proxy.user" value="<user>" />
<add key="http_proxy.password" value="<password>" />
</config>
</configuration>
Run Code Online (Sandbox Code Playgroud)
在nuget.config文件中。
| 归档时间: |
|
| 查看次数: |
120739 次 |
| 最近记录: |