httpclient PostAsJsonAsync method not found .net frame work 4 parallel solution

1
HttpClient client = new HttpClient();

var response = client.PostAsJsonAsync(url, obj).Result;

The method PostAsJsonAsync is not working in .NET Framework 4.0 even after adding dll -System.Net.Http.Formatting

error observed is -

Error 1 Could not load file or assembly 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

please help, thanks in advance

c#
asp.net
.net
asked on Stack Overflow Nov 28, 2015 by arya • edited Nov 28, 2015 by Christos

1 Answer

3

If you install the package Microsoft.AspNet.WebApi.Client, you will solve your problem. This is the Id of the package.

enter image description here

answered on Stack Overflow Nov 28, 2015 by Christos

User contributions licensed under CC BY-SA 3.0