Reputation: 1591
I am executing one SSIS package. I am trying to call one web api from that package.
My code:
IList<ESignDocumentServiceResponse> responseCollection = null;
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = new Uri(url);
HttpResponseMessage response = httpClient.GetAsync($"api/abc").Result;
responseCollection = response.Content.ReadAsAsync<IList<DocumentServiceResponse>>().Result;
But i am getting an error at line ReadAsAsync
as
"Error: Download failed: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."
I have already added System.net.http.formatting
in the project. But i am not sure why am i getting this error when i run this project.
Upvotes: 0
Views: 1925
Reputation: 1
Similar problem. I used Nuget to install "System.Net.Http.Formatting.Extension" version="5.2.3.0" This resolved the issue for me.
Upvotes: 0
Reputation: 90
Whenever I have a NuGet error such as these I usually take these steps:
Upvotes: 1