The original project was the WP8 version. Later, the newtonsoft. JSON. dll was used for an error because of the need to change it to WP7.
I guess it may be caused by different WP project versions. I found wp7.1-specific and still encountered errors such as failure to use methods.
Change the policy and use the built-in C # library to customize a conversion class. If datacontractjsonserializer is used, securityexception is returned.
After searching for Google, we found that the class to be serialized is not set to the public attribute and cannot be converted in WP8. However, errors may occur in versions below.
Not only JSON data, but also XML data. The serialization class must be set to public.
So far, both serialization and deserialization methods have returned to normal, removing the datacontractjsonserializer method.CodeNo need to change.
Datacontractjsonserializer in system. runtime. serialization. in the JSON namespace ,. net Framework 3.5 is included in system. servicemodel. web. DLL, you need to add a reference to it ;. NET framework 4 in the system. runtime. serialization.