Home >Backend Development >C++ >How Can I Configure NuGet Proxy Settings Using the Command Line?
Command-Line Proxy Settings for NuGet
NuGet provides proxy configuration capabilities from its early versions, but the absence of clear command-line examples has hindered its usage. This article addresses this issue and demonstrates how to set up proxy settings for NuGet via the command line.
Configuration Commands
To configure NuGet proxy settings, execute the following commands (replacing
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>
These commands add the proxy settings to the NuGet configuration file (NuGet.config) located in the user's roaming data folder (%appdata%NuGet). The generated configuration file might resemble the following:
<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>
Notes
The above is the detailed content of How Can I Configure NuGet Proxy Settings Using the Command Line?. For more information, please follow other related articles on the PHP Chinese website!