Recently I deployed an application into the live environment at work and all was running smoothly until a proxy setting change suddenly stopped the app being able to talk to the outside world. I didn’t much fancy having to rework the code to allow proxy authentication, so I did a bit of searching on Google, and came up with the following block to go into the app.config file.
<system.net> <defaultProxy enabled="true" useDefaultCredentials="true"> <proxy bypassonlocal="True" proxyaddress="http://proxy"/> </defaultProxy> </system.net>
Adding the section to the config file instructs the assembly to provide the default credentials to the proxy when requested, and saved me having to recompile and go through the system test phase or of product lifecycle. Hopefully it might save someone else the pain, too.