json support in visual studio 2010

20,776

Solution 1

I've been using Json.Net. (http://james.newtonking.com/pages/json-net.aspx) to serialize.

[Update: http://json.codeplex.com/ for latest version]

[Update Sept 27 2017: https://github.com/JamesNK/Newtonsoft.Json latest version no longer works in visual studio 2010]

Solution 2

I use System.Web.Script.Serialization.JavaScriptSerializer

However, since it does not work in Visual Studio 2010 without configuration, you'll have to figure out how to make it work yourself.

Solution 3

Here you can find a very well-written open-source solution for parsing JSON data:
http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html

It is not native, but I have used it recently and did the job...

Solution 4

Add a reference to System.Json. Add a reference to System.Json. I just did it and now my using statement is working fine.

Share:
20,776
jnsohnumr
Author by

jnsohnumr

Updated on July 09, 2022

Comments

  • jnsohnumr
    jnsohnumr almost 2 years

    I'm trying to work on a new project parsing some JSON data for a Silverlight 4 project (specifically created as a "Silverlight Business Application - Visual C#" project) using C# in Visual Studio 2010, and I can't find how to include the references to have parsers and native object support for JSON data.

    As far as I know my development tools are up to date (checked MS update).

    I know that I can probably just write my own parser but that seems like re-inventing the wheel. Below are some lines that work in VS 2008 in another project of ours (can't post the files due to their being part of a business app):

    using System.Json;

    results = (JsonObject)JsonObject.Load(e.Result);

    I hope my description is adequate.

    Thanks for looking,

    jnsohnumr