fuj*_*uji 6 c# arrays json.net mongodb
我遇到以下异常:
An error occurred while deserializing the Value property of class ExampleClass: Type 'Newtonsoft.Json.Linq.JToken' does not have a suitable constructor or Add method.
MongoDB.Bson.BsonSerializationException: Type 'Newtonsoft.Json.Linq.JToken' does not have a suitable constructor or Add method.
当它尝试从 MongoDB 读取具有以下“Value”键的条目时,问题似乎发生了:
"Value": {
"_t": "Newtonsoft.Json.Linq.JArray, Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed",
"_v": [{
"_t": "JValue",
"_v": []
}, {
"_t": "JValue",
"_v": []
}]
}
Run Code Online (Sandbox Code Playgroud)
“值”是一个对象:public object Value { get; set; }。
由于我已经研究这个问题 1.5 天了,所以我有点陷入困境,所以任何见解都很感激!
PS:它看起来像是"_v": []空的,但它不应该是空的,可能意味着它由于相同的异常而无法正确插入条目?...