Search code examples
json.net-corejson.netnuget-packagemonodevelop

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


I want to deserialize a string (json) to an object (i'd like dynamic).

I use monodevelop and nuget packages

I have been looking for Json.net but also found Newtonsoft.Json.

And I could make a JArray by using Newtonsoft.Json.Linq.

I read on

Json.NET vs Newtonsoft.Json SerializationBinder is different

that these are two versions of the same library?

The main goal is to convert Json to Yaml.


Solution

  • 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, etc.).

    However, in December 2018 (after the question you referenced was asked), another author unaffiliated with Newtonsoft released a completely different library on NuGet and called it Json.Net so now there is confusion. This other library advertises itself as a "A Minimalistic JSON handler" so it intentionally does not have very many features. It definitely does not have support for JArrays.