Visual Studio how to serialize object from debugger

后端 未结 10 1221
轻奢々
轻奢々 2020-12-22 16:39

I\'m trying to investigate a bug in a crash dump (so I can not change the code). I have a really complicated object (thousands of lines in the serialized representation) and

10条回答
  •  被撕碎了的回忆
    2020-12-22 17:43

    In case you have a circular reference, run this in the immediate Window:

    Newtonsoft.Json.JsonConvert.SerializeObject(app, Newtonsoft.Json.Formatting.Indented,
    new Newtonsoft.Json.JsonSerializerSettings
    {
        ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize
    });
    

提交回复
热议问题