在要求输入邮箱的文本域,请填写真实的邮件地址。非真实邮件地址,将收不到回复信息。

2020年01月11日的内容

DotNet

Newtonsoft.Json序列化对象时循环引用异常处理

因某些需求,需要将指定的对象序列化放到缓存中,在使用Newtonsoft.Json序列化时候报错,异常信息清晰明显就是循环引用问题。具体错误如下: 详细异常如下: fail: System.Exception[-2146233088] Self referencing loop detected for property ‘Ancestor’ with type ”. Path ‘Descendants[0]’. Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property ‘Ancestor’ with type ‘*’. Path &...

4年前 (2020-01-11) 2481℃ 0评论 4喜欢