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

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 07:05:04

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/13490661/anything-new-in-net-4-5-to-process-better-json

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!