title: http client frozes in windows form app
body: <p>I am following <a href="http://www.asp.net/web-api/overview/web-api-clients/calling-a-web-api-from-a-net-client" rel="nofollow">this example</a>, and it works in a console application, but then I tried in a windows form app and it forzes, when in hits the line <code>await client.GetAsync("api/branches/1035")</code>
  how is it diferent?</p>
  
  <p>console code (this works):</p>
  
  <pre><code>static void Main()
      {
          RunAsync().Wait();
      }
  
      static async Task RunAsync()
      {
          using (var client = new HttpClient())
          {
              client.BaseAddress = new Uri("http://localhost:49358/");
  
             client.DefaultRequestHeaders.Accept.Clear();
              client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
  
              HttpResponseMessage response = await client.GetAsync("api/branches/1035");
  
              if (response.IsSuccessStatusCode)
              {
                  branch branch = await response.Content.ReadAsAsync&lt;branch&gt;();
                  Console.WriteLine("{0}\t${1}", branch.Id, branch.Color);
              }
          }
      }
  </code></pre>
  
  <p>and this is frozen when it hits <code>await client.GetAsync("api/branches/1035")</code></p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
      {
          RunAsync().Wait();
      }
  
      static async Task RunAsync()
      {
          using (var client = new HttpClient())
          {
              client.BaseAddress = new Uri("http://localhost:49358/");
              client.DefaultRequestHeaders.Accept.Clear();
              client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
  
              HttpResponseMessage response = await client.GetAsync("api/branches/1035");
  
              if (response.IsSuccessStatusCode)
              {
                  Branch branch = await response.Content.ReadAsAsync&lt;Branch&gt;();
                  Console.WriteLine("{0}\t${1}", branch.Id, branch.Color);
              }
  
          }
      }
  </code></pre>