title: 'Task<HttpResponseMessage>' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter'
body: <p>I am using <code>HttpClient</code> in a class library project <code>(.net4.0)</code>. In order to get this working I have added nuget packages for Bcl</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;packages&gt;
    &lt;package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net40" /&gt;
    &lt;package id="Microsoft.Bcl" version="1.1.10" targetFramework="net40" /&gt;
    &lt;package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net40" /&gt;
    &lt;package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" /&gt;
    &lt;package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net40" /&gt;
    &lt;package id="Newtonsoft.Json" version="4.5.6" targetFramework="net40" /&gt;
  &lt;/packages&gt;
  </code></pre>
  
  <p>But I still get the error message</p>
  
  <blockquote>
    <p><em>"Severity    Code    Description Project File    Line    Suppression State Error CS1061  'Task' does not contain a definition
    for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a
    first argument of type 'Task' could be found (are
    you missing a using directive or an assembly reference?)"</em></p>
  </blockquote>
  
  <p>Code I am using is below</p>
  
  <pre><code>private async Task&lt;bool&gt; Login()
  {
      try
      {
          var status = false;
          using (HttpClient client = new HttpClient())
          {
  
              client.DefaultRequestHeaders.Add("username", _userName);
              client.DefaultRequestHeaders.Add("password", _password);
  
              using (HttpResponseMessage response = await client.PostAsync(_url, null))
              {
                  if (response.StatusCode == System.Net.HttpStatusCode.OK)
                  {
                      var contents = await response.Content.ReadAsStringAsync();
                      AuthenticationResult result = JsonHelper.DeserializeJson&lt;AuthenticationResult&gt;(contents);
                      if (result != null) _authToken = result.authToken;
                  }
              }
          }
          return status;
      }
      catch (Exception ex)
      {
          return false;
      }
  
  }
  </code></pre>
  
  <p>Strange thing is if I change the project output type to <code>Windows Application</code> error goes away and this start working. This error only comes when the project is a <code>Class Library</code></p>