LINQBridgeVs
LINQBridgeVs copied to clipboard
Possible interfering with HTTP Client deserializing
After installing LINQBridge one of our project was throwing runtime errors. We debugged and found the problem in serializing/deserializing data. The error was in the BaseHTTPClient After replacing ` protected static T ReadResponse<T>(HttpResponseMessage response) { if (response.IsSuccessStatusCode) { var task = response.Content.ReadAsAsync<T>(); return task.Result; }
response.EnsureSuccessStatusCodeWithContent();
return default(T);
}
`
with this ` protected static T ReadResponse<T>(HttpResponseMessage response) { List<MediaTypeFormatter> m = new List<MediaTypeFormatter>(); m.Add(new JsonMediaTypeFormatter { SerializerSettings = new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All } });
if (response.IsSuccessStatusCode)
{
var task = response.Content.ReadAsAsync<T>(m);
return task.Result;
}
response.EnsureSuccessStatusCodeWithContent();
return default(T);
}
`
The problem was solved
Hi Eric,
Thanks for reporting this issue. The installation itself shouldn't generate issues, however I guess you bridged the entire solution, is that correct?
I would need more info to replicate this bug, could you tell me the definition of type T that is generating the runtime error? Also, what exception are you seeing?