JSON.NET JsonConvert VS .NET JavaScriptSerializerNET、JSON、JsonConvert、JavaScriptSerializer

2023-09-03 00:52:04 作者:神回复

什么是更好的,当涉及到编码和JSON的.NET解码使用?我曾经尝试都和高达至此JsonConvert似乎是在做一个好工作。我已经使用JavaScriptSerializer过去成功但有在最近的过去与它存在一些问题。它是更好地使用JSON.NET比.NET类?

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?

什么是使用适当的库preferred编码/解码JSON的功能?我用SerializeObject / DeSerializeObject从JSON.NET和序列化/反序列化的.NET。

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.

感谢

推荐答案

我没有足够的代表处发表评论还因此不得不张贴此作为回答。我想这正是那种你正在寻找比较。

I don't have enough rep to comment yet so had to post this as an answer. I think this is exactly the kind of comparison you are looking for.

这基本上说,JSON.Net是更好,因为它除其他事项外...

It basically says that JSON.Net is better because it among other things...

是更快 的 LINQ 以JSON支持 能转换 JSON和从 XML 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.