Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

json.net vs DataContractJsonSerializer

I know there's a DataContractJsonSerializer that comes now with the .net framework and is used by wcf ajax enabled services. However, I've noticed there's also a json.net project over at codeplex. I'm wondering if there are any advantages or features that are present in the codeplex project that are missing from the .net framework.

like image 816
dortzur Avatar asked Jan 28 '11 09:01

dortzur


People also ask

Is JSON net the same as Newtonsoft?

Json.net is made by newtonsoft.

Is JSON net deprecated?

Json was basically scrapped by Microsoft with the coming of . NET Core 3.0 in favor of its newer offering designed for better performance, System.

Is Newtonsoft JSON obsolete?

Obsolete. The value types allowed by the JsonSchema. JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details.

What is Newtonsoft JSON net?

The Newtonsoft. JSON namespace provides classes that are used to implement the core services of the framework. It provides methods for converting between . NET types and JSON types.


2 Answers

json.net has next pros:

  • Control over how dates get formatting (the \/Date(123)\/ MS AJAX style)
  • The ability to serialize object graphs that contain cycles (by telling Json.NET to ignore them)

There are a lot of explanation how its reflects on WCF developing here.

Also, regarding to http://banachowski.com/deprogramming/2010/08/json-net-vs-net-datacontractjsonserializer/ it has better performance, but this results can be argued.

like image 144
apros Avatar answered Oct 05 '22 23:10

apros


I have used DataContractSerializer and JavaScriptSerializer and I love them. However JSON.Net is quite more feature rich and was available long before .NET had such features.

like image 29
Shekhar_Pro Avatar answered Oct 05 '22 23:10

Shekhar_Pro