Does .NET 4 have a built-in JSON serializer/deserializer?

Cheung picture Cheung · Jul 18, 2010 · Viewed 66.4k times · Source

Does .NET 4 come with any class that serializes/deserializes JSON data?

  • I know there are 3rd-party libraries, such as JSON.NET, but I am looking for something built right into .NET.

  • I found Data Contracts on MSDN, but it is for WCF, not for Winforms or WPF.

Answer

Ben Robinson picture Ben Robinson · Jul 18, 2010

You can use the DataContractJsonSerializer class anywhere you want, it is just a .net class and is not limited to WCF. More info on how to use it here and here.