title: 'System.Net.Http.HttpContent' does not contain a definition for 'ReadAsAsync' and no extension method
body: <p>I made a console app to consume a Web API I just made. The console app code does not compile. It gives me the compilation error:</p>
  
  <pre><code>'System.Net.Http.HttpContent' does not contain a definition for 
  'ReadAsAsync' and no extension method 'ReadAsAsync' accepting a 
  first argument of type 'System.Net.Http.HttpContent' could be 
  found (are you missing a using directive or an assembly reference?)
  </code></pre>
  
  <p>Here's a test method in which this error occurs.</p>
  
  <pre><code>static IEnumerable&lt;Foo&gt; GetAllFoos()
  {
    using (HttpClient client = new HttpClient())
    {
      client.DefaultRequestHeaders.Add("appkey", "myapp_key");
  
      var response = client.GetAsync("http://localhost:57163/api/foo").Result;
  
      if (response.IsSuccessStatusCode)
        return response.Content.ReadAsAsync&lt;IEnumerable&lt;Foo&gt;&gt;().Result.ToList();
    }
  
    return null;
  }
  </code></pre>
  
  <p>I have used this method and consumed it from an MVC client.</p>