Coffeehouse Post

Single Post Permalink

View Thread: 'System.Net.Http.HttpContent' does not contain a definition for 'ReadAsAsync' and no extension method
  • User profile image
    Sathyaish Chakravarthy

    After a long struggle, I found the solution.

    Solution: Add a reference to System.Net.Http.Formatting.dll. This assembly is also available in the C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies folder.

    The method ReadAsAsync is an extention method declared in the class HttpContentExtensions, which is in the namespace System.Net.Http in the library System.Net.Http.Formatting.

    Reflector came to rescue!