我需要将列表序列化为JSON字符串,但它抛出了下一个错误: System.Text.Json.JsonException: 'A possible object cycle was detected which我想要一个真正的最大深度,比如2,这样我的System.Text.Json.JsonSerializer就不会崩溃。我们故意不想使用NewtonSoft JSON。
在.NET Core5.0中,使用System.Text.Json.JsonSerializer反序列化(SomeJsonFile)我得到: System.Text.Json.JsonException: 'The JSON value could not be converted to System.Guid.这是预期的,因为someGuid属性的类型是System.Guid,并且JSON文件/字符串中的someGuid的值是: {
"someGuid
return Ok(cityResponses);
我可以在执行这一行之前看到数据。System.NotSupportedException: The collection type 'Newtonsoft.Json.Linq.JObject' is not supported.at System.Text.Json.JsonPropertyInfoNotNullable`4.GetDictionaryKeyAndValueFromGenericDictionary(WriteStackFrame& writeS