How to convert object to JSON without JSON.NET library?

c#, json, serialization

Solution

If you want to serialize class into Json you can try this one too:

Install JSON.NET if you haven't yet.

make sure to include `using Newtonsoft.Json;`

and you can try this code:

Student s = new Student();
string json = JsonConvert.SerializeObject(s);

sorry for my bad english.

Problem

I want to save this object: ``` Student s = new Student(); ``` to Json file. But Visual Studio 2012 can't find none of these namespaces: ``` System.Web.Script; System.Json; System.Runtime.Serialization.Json; ``` Any idea?

Original source

Related problems