ASP.NET Core – How to make the controllers use Newtonsoft

By default, ASP.NET Core uses System.Text.Json for JSON serialization. If you want to use Newtonsoft instead, you can add the Microsoft.AspNetCore.Mvc.NewtonsoftJson nuget package, then call AddNewtonsoftJson() in Startup.ConfigureServices() like this: In this article, I’ll show how to configure the Newtonsoft serializer options. Install the right nuget package Microsoft packaged up Microsoft.AspNetCore.Mvc.NewtonsoftJson based on the framework … Read more