1
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 
Stream respStream = response.GetResponseStream(); 
using (var sr = new StreamReader(respStream, Encoding.UTF8)) 
using (JsonReader reader = new JsonTextReader(sr)) 
{ 
    JsonSerializer serializer = new JsonSerializer(); 
    ServiceModel toReturn = serializer.Deserialize<ServiceModel>(reader); 
    String resps = JsonConvert.SerializeObject(toReturn, Formatting.Indented); 
    } 

Obtenir exception OutOfMemory sur cette ligne après:Mémoire insuffisante Exception. C#

String resps = JsonConvert.SerializeObject(toReturn, Formatting.Indented);.

Comment gérer ceci en C# (Compact Framework).

Répondre