I am using System.Net.Http.HttpClient
to access a rest service. This code compiles and runs just fine:
var client = new HttpClient();
var result = client.GetAsync(ServiceUrl + "/whatever").Result;
var content = result.Content.ReadAsAsync<StatusReport>().Result;
However the ReadAsAsync
method is colored red in my IDE, and intellisense cannot find it. I have made sure to update all of my nuget packages. Referenced and added using statement for System.Net.Http.Formatting
, but error persists (and resharper tells me the using statement is unused).
I am not sure if this is a problem with visual studio 2012, or with resharper 7. Sometimes restarting visual studio helps, and sometimes it doesn't. I suspect I may have some older version of some assembly referenced, or something like that, but I have updated everything I know how and the problem is still intermittent.
What else can I try?
You must add reference from Nuget "ASP.NET Web API 2 Client". Microsoft.AspNet.WebApi.Client
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With