Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anything new in .Net 4.5 to process better JSON? [closed]

Is there anything new about JSON handling in .NET 4.5 and VS2012 that would be better than DataContractJsonSerializer? I have seen something about System.JSON. But is it better?

I know there is JSON.NET too, but i am not sure if i am allowed to add another .dll to my project.

like image 432
Gero Avatar asked Nov 21 '12 10:11

Gero


People also ask

Does .NET support Json?

Text. Json namespace provides functionality for serializing to and deserializing from JavaScript Object Notation (JSON).

Does .NET have a Json parser?

NET core 3.0 comes with System. Text. Json built-in which means you can deserialize/serialize JSON without using a third-party library.

What is the newest .NET framework?

. NET Framework 4.8 can be installed on Windows 11, Windows 10 version 21H2, Windows 10 version 21H1, Windows 10 version 20H2, and the corresponding server platforms starting with Windows Server 2022. You can install . NET Framework 4.8.

Which namespace is used for converting between .NET types and Json types?

Introduction. The Newtonsoft. Json namespace provides classes that are used to implement the core services of the framework. It converts an object to and from JSON.


2 Answers

Check this link:

Feature Comparison - Json.NET, DataContractJsonSerializer & JavaScriptSerializer

It has a good feature comparision between Json.NET, DataContractJsonSerializer & JavaScriptSerializer. Just have a look at it & then decide which one to use based on your requirement.

Also, check this:

ASP.NET MVC 4 & Json.NET :

We (.Net Team) now use and support the popular Json.NET serializer for handling of JSON data. Json.NET is the default JSON serializer used by ASP.NET Web API and it includes support for data contracts, anonymous types, dynamic types, Dates, TimeSpans, object reference preservation, indenting, camel casing and many other useful serialization features.

like image 139
Kapil Khandelwal Avatar answered Oct 17 '22 23:10

Kapil Khandelwal


You could always use System.Web.Script.Serialization.JavascriptSerializer - I don't know why more people don't use it, it's been there a while.

http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx

like image 26
PhonicUK Avatar answered Oct 17 '22 22:10

PhonicUK