Json.NET is a popular high-performance JSON framework for .NET
125
votes
6answers
131k views
Parse JSON in C#
I'm trying to parse some JSON data from the Google AJAX Search API. I have this URL and I'd like to break it down so that the results are displayed. I've currently written this code, but I'm pretty ...
85
votes
4answers
102k views
Parsing JSON using Json.net
I'm trying to parse some JSON using the JSon.Net library. The documentation seems a little sparse and I'm confused as to how to accomplish what I need. Here is the format for the JSON I need to ...
155
votes
10answers
95k views
How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?
I have a simple key/value list in JSON being sent back to ASP.NET via POST. Example:
{ "key1": "value1", "key2": "value2"}
I AM NOT TRYING TO DESERIALIZE INTO STRONGLY-TYPED .NET OBJECTS
I simply ...
51
votes
2answers
20k views
How to implement custom JsonConverter in JSON.NET to deserialize a List of base class objects
I am trying to extend the JSON.net example given here
http://james.newtonking.com/projects/json/help/CustomCreationConverter.html
I have another sub class deriving from base class/Interface
public ...
31
votes
3answers
13k views
Using JSON.net as default JSON serializer in ASP.NET MVC 3 - Is it possible?
Is it possible to use JSON.net as default JSON serializer in ASP.NET MVC 3?
According to my research, it seems that the only way to accomplish this is to extend ActionResult as JsonResult in MVC3 is ...
40
votes
8answers
59k views
Json.NET: convert JSON string to XML or XML to JSON string
I started to use Json.NET to convert a string in JSON format to object or viceversa. I am not sure in the Json.NET framework, is it possible to convert a string in JSON to XML format and viceversa?
54
votes
4answers
16k views
Deserialize json object into dynamic object using Json.net
Is it possible to return a dynamic object from a json deserialization using json.net? I would like to do something like this:
dynamic jsonResponse = JsonConvert.Deserialize(json);
...
16
votes
8answers
13k views
Using Json.NET converters to deserialize properties
I have a class definition that contains a property that returns an interface.
public class Foo
{
public int Number { get; set; }
public ISomething { get; set; }
}
Attempting to serialize ...
6
votes
2answers
6k views
How to set Json.Net as the default serializer for WCF REST service
Is it possible to override the default WCF DataContractSerializer behaviour when Serialize/DeSerialize entities and use JSON.NET instead?
I have the following service contract for handling the City ...
8
votes
2answers
3k views
Json.NET: Deserializing nested dictionaries
When deserializing an object to a Dictionary (JsonConvert.DeserializeObject<IDictionary<string,object>>(json)) nested objects are deserialized to JObjects. Is it possible to force nested ...
29
votes
5answers
39k views
Deserializing JSON data to C# using JSON.NET
I'm relatively new to working with C# and JSON data and am seeking guidance. I'm using C# 3.0, with .NET3.5SP1, and JSON.NET 3.5r6.
I have a defined C# class that I need to populate from a JSON ...
47
votes
3answers
69k views
deserializing JSON to .net object using NewtonSoft (or linq to json maybe?)
I know there a few posts about Newtonsoft so hopefully this isn't exactly a repeat...I'm trying to convert JSON data returned by Kazaa's API into a nice object of some kind
WebClient client = new ...
20
votes
5answers
6k views
JSON.NET and nHibernate Lazy Loading of Collections
Is anybody using JSON.NET with nHibernate? I notice that I'm getting errors when i try to load a class with child collections.
Thanks
Graham
17
votes
5answers
19k views
Parsing JSON DateTime from Newtonsoft's JSON Serializer
I've serialized an object using Newtonsoft's JSON serializer, and the DateTime has come through as:
/Date(1237588418563+0000)/
When I $.evalJSON() on that, it is an object but I can't find any ...
14
votes
2answers
5k views
Deserializing JSON when sometimes array and sometimes object
I'm having a bit of trouble deserializing data returned from Facebook using the JSON.NET libraries.
The JSON returned from just a simple wall post looks like:
{
"attachment":{"description":""},
...