I have a program that deserializes large objects from a web service. After calling webservice and 200, the code is as follows.
JsonConvert.DeserializeObject<List<T>>(resp.Content.ReadAsStringAsync().Result).ToList()
Sometimes during the execution of this process I get a generic exception that shows the internal exception as out of memory. I cannot determine if this is the reading process in the JSON data string (which is probably terribly large), or Deserializing, which causes this problem. What I would like to do is tear a line and pull out each JSON object separately from the response, and then deserialize it. I just find it difficult to find a way to output only one JSON object at a time from the response. Any suggestions are welcome!
source share