Saturday, March 30, 2019

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.

1 comment:

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

    ReplyDelete