title: System.Net.WebClient - what's the best way of getting (non-default) proxy credentials?
body: <p>I am writing a (WiX Burn) installer that needs to get licence information from our ASP.NET server. We are using the System.Net.WebClient to make this request.</p>
  
  <p>Some of our customers are using authenticating proxies, which return 407 responses to our installer.</p>
  
  <p>I initially tried passing on the default credentials as per <a href="https://stackoverflow.com/questions/9603093/proxy-basic-authentication-in-c-http-407-error">this post</a>. However, on my machine and with the test proxy that I've set up, I'm getting the same issue as in <a href="https://stackoverflow.com/questions/38734738/c-sharp-httpwebrequest-not-sending-default-credentials-to-proxy-server">this post</a> where my default credentials simply aren't being picked up for some reason.</p>
  
  <p>In any case, I imagine there will be cases where the proxy credentials are different from the default Windows credentials and the user will need to supply their proxy credentials manually.</p>
  
  <p>I've seen a number of different options in Windows for this:</p>
  
  <ul>
  <li>Use the <code>CredUIPromptForCredentials</code> dialog, which Visual Studio seems to use.</li>
  <li>Use the more modern version <a href="https://stackoverflow.com/questions/4134882/show-authentication-dialog-in-c-sharp-for-windows-vista-7"><code>CredUIPromptForWindowsCredentials</code> dialog</a>.</li>
  <li>Use the <a href="https://stackoverflow.com/questions/4204677/display-the-proxy-authentication-dialog-in-c-sharp"><code>InternetErrorDlg</code> dialog</a></li>
  <li>Forget about using the Windows dialogs and just deal with it in the installer UI.</li>
  </ul>
  
  <p>What is the best way of doing this? Does it matter?</p>
  
  <p>BONUS POINTS for helping with the issue of my default Windows credentials not being picked up by the <code>WebClient</code>!</p>