4

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

1
  • 1
    I wish someone would have answered the question you asked, because I'm seemingly in a similar boat. Jul 20, 2010 at 1:42

4 Answers 4

5

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.

4

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]

0
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...

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.