Serialize an Object Using JSON

When we intend to serialize an object via JSON, we need to use DataContractJsonSerializer class , it is necessary to add two references below:

System.ServiceModel.Web

System.Runtime.Serialization.Json

If you want to add these two references, you need to change the Project’s property as the image below inlustrated

net4

when vs2010 create a project, you use .NET Framework 4 Client Profile defaultly.

原文地址:https://www.cnblogs.com/wildboar/p/2194496.html