How to parse JSON in a .netcore class library

3.1k views Asked by At

I am creating a cross-platform library using the .NET core class library project template and need to communicate with a REST service using JSON.

I can't use the JSON.NET Nuget package or "System.Runtime.Serialization.Json" because neither of these packages support .netcore.

For legacy reasons as well as netstandard1.2 I am also targeting net40.

1

There are 1 answers

3
Ivan Prodanov On BEST ANSWER

You can use Newtonsoft.Json.

Alternatively, you could write metadata for it in the Swagger format and use AutoRest to automatically generate a proxy class for you. Internally the generated code from AutoRest uses Newtonsoft.Json for json serialization.