title: httpwebrequest proxy authentication with .net framework 3.5 return 407 error
body: <p>I use this code in .net framework 3.5 project:</p>
  
  <pre><code>HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(ServiceUri);
  WebProxy proxy = new WebProxy();
  proxy.Address = new Uri(ProxyUri);
  proxy.Credentials = new NetworkCredential(userName, pass, domain);
  request.Proxy = proxy;
  request.Method = "POST";  
  request.ContentType = "application/xml";
  request.Accept = "application/xml";
  byte[] content = Encoding.UTF8.GetBytes(xmlRequest.ToString());
  request.ContentLength = content.Length;
  using (var stream = request.GetRequestStream())
  {
     stream.Write(content, 0, content.Length);
  }
  HttpWebResponse response = (HttpWebResponse) request.GetResponse();
  </code></pre>
  
  <p>The last line gives me "407 proxy authentication required". But it work if I add to config:</p>
  
  <pre><code>  &lt;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /&gt;
    &lt;/startup&gt;
  </code></pre>
  
  <p>How can I make it work without using clr 4.0?</p>