JSON.NET JsonConvert vs .NET JavaScriptSerializer
.net, json, json.net
Solution
I think this is exactly the kind of comparison you are looking for.
It basically says that JSON.Net is better because it among other things...
- Is faster
- Has LINQ to JSON support
- Can convert JSON to and from XML
In my opinion the only positive, (and it is a small positive), I can see for the built-in serializer is that there is no extra external dependency to manage.
Edit: Codeplex is shutting down one day so you can find the comparison here as well, just search for "Feature comparison" on the page.
Problem
What is better to use when it comes to encoding and decoding of JSON in .NET? I have tried both and upto this point JsonConvert seems to be doing a good job. I have used JavaScriptSerializer in the past successfully but have had some problems in the recent past with it. Is it better to use JSON.NET than the .NET class? What are the preferred functions for encoding/decoding json using the appropriate library? I use SerializeObject/DeSerializeObject from JSON.NET and Serialize/DeSerialize from .NET. Thanks