json.net vs DataContractJsonSerializer
I know there's a DataContractJsonSerializer that com开发者_如何学Pythones 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.
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.
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.
You can find a full feature comparison in the Json.Net documentation:
http://james.newtonking.com/json/help/?topic=html/JsonNetVsDotNetSerializers.htm
精彩评论