代码改变世界

Serialize an Object Using JSON

2011-09-28 15:45  wildboar  阅读(224)  评论(0)    收藏  举报

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.