json.net

What is the most flexible serialization for .NET objects, yet simple to implement?

I would like to serialize and deserialize objects without having to worry about the entire class graph. Flexibility is key. I would like to be able to serialize any object passed to me without complete attributes needed throughout the entire object graph. That means that Binary Serialization is not an option as it only works with...

Is there a library to read JSON in C# on Windows Mobile?

Hi, I am trying to find a library to parse JSON on C# on Windows Mobile (working with Visual Studio 2005). The libraries that I have found that allow me to parse JSON in C# (litjson and Jayrock) don't work on Windows Mobile, they require classes that are not present in the .NET compact framework. Is there any library that I have overloo...

JSON.NET and nHibernate Lazy Loading of Collections

Hi there 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 ...

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 parse through. { "displayFieldName" : "OBJECT_NAME", "fieldAliases" : { "OBJECT_NAME" : "OBJECT_NAME", "OBJECT_TYPE" : "OBJECT_T...

Creating lightweight Linq2Sql proxy objects

I'm trying to find the most efficient way to send my Linq2Sql objects to my jQuery plugins via JSON, preferably without additional code for each class. The EntitySets are the main issue as they cause not only recursion, but when recursion is ignored (using JSON.NET's ReferenceLoopHandling feature) a silly amount of data can be retrieved...

Deserializing json from client in json.net 3.5b2 in vb.net

I have a test case of a problem I'm having, basically I create a json object on the server and provide it back to an AJAX called made on the client side. That works fine, however, when I try to send it back and deserialize it server side I get the following exception: No parameterless constructor defined for type of 'System.String'. ...

Which is faster asp.net mvc json or json.net?

I was wondering if anyone has run any benchmark tests on the JSON() function in Asp.net MVC and how it compares to JSON.NET? Also which one outputs the best json strings? ...

Type or namespace 'Linq' doest not exist in the namespace 'System'

I am trying to build the Json.NET 2.0 library to target the .NET framework version 2.0, and I am getting this error several times. I went to add a reference to System.Linq to the project, but it does not exist in the references list! What should I do? ...

Json.Net How to Serialize a JObject without the formatting?

This is basically my problem: I have a JObject (I'm using Json.Net) that I constructed with LINQ to JSON (also provided by the same library) and, when I use the "ToString()' method with object, it throws the results in formated JSON. How do I set the formatting to "none" for this? Thanks in adavance =) ...

Deserializing Chrome Bookmark JSON Data in C#

In response to a question I asked a few days ago, I'm attempting to stretch myself a little, and do something that I've not really focussed on much before. I've done some searching (both here, and in general), but can't find the answers (or even reasonable hints) to what I want to achieve (though, a few things come close-ish). Basicall...

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 normal Date methods like toUTCString on it. Any ideas what I can do with this? ...

Json Import fails - C#

I have the following class structure public class AreaFields { public List<Fields> Fields { set; get; } } public class Fields { public string Name { set; get; } public string Value {set; get; } } When I export to Json using Jayrock.Json.Conversion.JsonConvert.ExportToString(List<AreaField> obj), everything works fine. The...

Google Visualization API .net?

How can i use data in my .NET app that is coming in google's visualisation api json format? Can't imagine at the moment how to use this data. Do i have to parse the json to an object by myself? Can i use Json.NET to deserialize it? For now i have no idea how start with this. Any help is appreciated. Data looks like this: { cols: [ ...

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 vice visa. I am not sure in the JSON.Net framework, is it possible to convert a string in json to xml format and vice visa? ...

JSON.Net: Convert JSON string from XML string to instance issue

I have the following function: public static T GetInstance<T>(string xmlString) { var xmlDoc = new XmlDocument(); xmlDoc.Load(new StringReader(xmlString)); string jsonString = JsonConvert.SerializeXmlNode(xmlDoc.DocumentElement); T instance = JsonConvert.DeserializeObject(jsonString, typeof(T)) as T; return instance; } ...

JSON.Net and typed datasets

Hello! Does anyone know if JSON.net can serialize/deserialize typed datasets in asp.net? Or if not, are there any other options to do this? I looked around but couldn't find anything in the JSON.net docs that explicitly said 'yes' to support of typed datasets. Thanks! Eric ...

Json.net property: single value or array of values

I have a question regarding the JSON.Net library. Normally I have a XML string like this: <Config> .... <Name>some name</Name> .... </Config> Then I use JSON.Net library to transform the string to a json string like this: Congif: { ... Name: "some name", ... } Finally I map this json string to an instance of Config c...

Adding json.net to project

Hi I have downloaded json.net. and added the dll file by clicking Add Reference. The dll file is now appearing in the bin folder. Now in the code I have tried calling the functions from Json.net Imports Newtonsoft.Json.JsonReader Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByV...

How Do I filter Generic List<> with Object of same Class

I have scoured the internet for this answer and asked several developers and have come up short. I have a Class called StaffingPositionsDataContract that I am loading mock data (for now) into a List<> and returning to a page. This is working great, but now I need to filter the list based on another list of values that are inputted on t...

Good .NET libraries for working with JSON data?

I am currently trying out Json.NET, and it seems to work well. Any other good JSON libraries for .NET? ...