Method not found System.Net.Http.HttpContentExtensions.ReadAsAsync

Bumped into this error when moving my web app to another server. It happened to me before but this time the cause is different. So two ways that worked for me:

1. Install package Microsoft.AspNet.WebApi.Client. This will provide access to HttpFormatting.dll which actually contains the ReadAsAsync method and fixed the issue for me before.

2. I found out that my System.Net.Http was not referenced properly because it depends on the dll installed in the machine. So, installing System.Net.Http NuGet package fix the current issue for me.

Comments

  1. in my case same code is working on 1 server and giving error on another server. the configuration is same

    ReplyDelete

Post a Comment

Popular posts from this blog

AWS EC2 Can't Reach EC2 Metadata Service After Subnet Change

A2 Hosting with .NET Core 2.1

Xcode CodeSign Incorrectly States Password is Incorrect