Unable to cast object of type Newtonsoft.Json.Linq.JObject even though I am trying to cast to an object with matching properties
问题 I am working with ASP.NET Core 2.0 in VS2017. I am trying to deserialize some JSON that is returned in an HttpResponseMessage but I am getting an "Unable to cast object of type..." exception. Here is the code that is failing; FilesUploadedListResponse fileUploadListResponse = new FilesUploadedListResponse(); string jsonResult = response.Content.ReadAsStringAsync().Result; fileUploadListResponse = (FilesUploadedListResponse)JsonConvert.DeserializeObject(jsonResult); The last line is where I