title: HttpWebRequest only running on .NET 4.0
body: <p>I got a strange problem or even behaviour with a WebRequest. First and foremost, here's what I'm trying to do:</p>
  
  <pre class="lang-vb.net prettyprint-override"><code>Dim req As HttpWebRequest = CType(Net.WebRequest.Create("https://cloud.myweb.de/myenginge/dostuff"), HttpWebRequest)
  
  Dim inputString As String = "text=DoStuff"
  Dim data As Byte() = System.Text.Encoding.ASCII.GetBytes(inputString)
  
  req.Method = "POST"
  req.Accept = "application/xml;q=0.9,*/*;q=0.8"
  
  req.ContentType = "application/x-www-form-urlencoded"
  req.ContentLength = data.Length
  
  str2 = req.GetRequestStream()
  
  str2.Write(data, 0, data.Length)
  str2.Close()
  
  Dim resp As HttpWebResponse = CType(req.GetResponse, HttpWebResponse)
  str = resp.GetResponseStream()
  buffer = New IO.StreamReader(str, System.Text.Encoding.ASCII).ReadToEnd
  </code></pre>
  
  <p>But having the .NET Frame 3.5 set in my compile settings will lead to a timeout in:</p>
  
  <pre class="lang-vb.net prettyprint-override"><code>str2 = req.GetRequestStream()
  </code></pre>
  
  <p>while setting the Framework Version 4.0 works and everything passes without any timeout issue. Does anybody know why this happens? I tried 3.0 as well, and it didn't work either.</p>
  
  <p>(I'm using VB.NET in this example, but C# solutions are also welcome.)</p>