【发布时间】:2018-05-03 12:19:47
【问题描述】:
我正在执行一个 SSIS 包。我正在尝试从该包中调用一个 Web api。
我的代码:
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;
但我在ReadAsAsync 行遇到错误
“错误:下载失败:无法加载文件或程序集 'System.Net.Http.Formatting,版本=5.2.3.0,文化=中性, PublicKeyToken=31bf3856ad364e35' 或其依赖项之一。这 系统找不到指定的文件。”
我已经在项目中添加了System.net.http.formatting。但是我不确定为什么在运行这个项目时会出现这个错误。
【问题讨论】:
标签: c# asp.net-web-api ssis ssis-2012