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
If you install the package Microsoft.AspNet.WebApi.Client
, you will solve your problem. This is the Id of the package.
User contributions licensed under CC BY-SA 3.0