如何使用 json.net 反序列化字符串 - 是否有两个版本的库?

How to deserialize string with json.net - are there two versions of the library?

我想将一个字符串 (json) 反序列化为一个对象(我想要动态的)。

我使用 monodevelop 和 nuget 包

我一直在寻找 Json.net 但也找到了 Newtonsoft.Json。

我可以通过 使用 Newtonsoft.Json.Linq.

制作一个 JArray

我继续阅读

Json.NET vs Newtonsoft.Json SerializationBinder is different

这是同一个库的两个版本?

主要目标是将 Json 转换为 Yaml。

Newtonsoft.Json is most likely the one you want. It has been known as "Json.Net" since it was first released in 2006 and has many features, including the LINQ-to-JSON API(JObject、JArrays 等)。

但是,在 2018 年 12 月(在提出您提到的问题之后),另一位与 Newtonsoft 无关的作者在 NuGet 上发布了一个 completely different library 并将其命名为 Json.Net,所以现在出现了混乱。这个其他库将自己宣传为 "A Minimalistic JSON handler",因此它有意没有很多功能。它绝对不支持 JArrays。