When deserializing a string returned by the calling interface, it appears that the element "root" should be from the namespace "". Encounter "None" with the name "" and the Namespace "". , which causes the deserialization of the data to fail, and sometimes does not directly prompt the deserialization failure (throw exception), but instead of the normal deserialization of the partial discard (value is null), check the information on the Internet, there is the use of deserialization and serialization version inconsistency, there is a namespace problem, I checked the seemingly no problem, there is no way, directly first instantiate a, after serialization and the interface returns the value to do the comparison. Finally find out where the problem is.
Because the attribute of my own defined class is keys, the name of the property returned by the two interfaces is the keys, very similar, if the attribute field is more, not seriously, it really does not look, I define the beginning of the property is uppercase, two and the interface returns the beginning of the property is lowercase, good pit pit .... Change the property name to match the name returned by the interface, it will be able to parse correctly. NET is very sensitive to case, also blame oneself thickness careless ... In this note, I hope to encounter a similar situation can see if it is the same as my situation ... Hope to be helpful!
In the future to do the JSON format interface as far as possible to ensure that important fields (attributes) consistent, all uppercase or lowercase, convenient for others.
When you deserialize a JSON string in C #, you should be prompted with the element "root" from the namespace "": Encounter "None" with the name "" and the Namespace "".