If you specify a configuration file when running nuget.exe some settings in this file are ignored. Especially the "http_proxy" setting has no functionality. It only works when specifying the proxy settings in the default config locations (e.g. %APPDATA%NuGetNuGet.Config).
Nuget.exe Version: 2.8.60318.667
Windows 7 Enterprise x64
That makes it imposible to declare different proxies for package restoring. We are running Jenkins builds and some packages are stored on a private nuget repository. Additionally neither pac-Files (Proxy-Auto-Config) nor excluded hosts are supported in the default proxy configuration. With Jenkins the browser proxy settings have no effect, so we have to declare them by config file.
See also the related old issue on codeplex: https://nuget.codeplex.com/workitem/4121
This is an issue on the latest Nuget client as well. Even without -ConfigFile, settings like package sources are used in a Nuget.config residing next to a solution file, but not proxy settings.
I'm hitting this issue too.
Is there a known work around to this issue?
Ta
@grillba It can also be set via environment variables http_proxy and no_proxy. http_proxy should be specified in the format http://[username]:[password]@proxy.com whereas no_proxy should be a comma-separated list of domains to bypass the proxy server.
Thanks. I'd worked out to just set the proxy as part of the msbuild script.
<Exec Command="nuget.exe config -set http_proxy=http://[username]:[password]@proxy.com" />
<Exec Command="nuget.exe restore @(SolutionFile)" />
For future readers, looking at the code, it appears that only the user-level config works for proxy settings. This matches the behavior I see, at least on dotnet 2.2.401.
Most helpful comment
@grillba It can also be set via environment variables
http_proxyandno_proxy.http_proxyshould be specified in the formathttp://[username]:[password]@proxy.comwhereasno_proxyshould be a comma-separated list of domains to bypass the proxy server.