我从ios应用程序(ipad)调用一个安静的Web服务并收到此错误消息:System.TypeLoadException:加载类型时发生了故障。到达此行时:System.Net.Http.HttpResponseMessage response = await client.GetAsync(RestUrl)。
以下是代码:
public async Task<DataTable> GetSSRListAsync()
{
DataTable dt = new DataTable();
var RestUrl = "http://10.50.42.51:2018/SiteSafetyService.svc/GetSSRList";
//var uri = new Uri(string.Format(Constants.RestUrl, string.Empty));
System.Net.Http.HttpResponseMessage response = await client.GetAsync(RestUrl);
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
dt = Newtonsoft.Json.JsonConvert.DeserializeObject<DataTable>(content);
}
return dt;
}