I'm in Net core 3.1 and I'm trying to use AddNewtonsoftJson()
I'm getting:
"IMvcBuilder' does not contain a definition for 'AddNewtonsoftJson' and no accessible extension method 'AddNewtonsoftJson' accepting a first argument of type 'IMvcBuilder' could be found (are you missing a using directive or an assembly reference?)"
This is what I write in my ConfigureService:
services.AddControllers().AddNewtonsoftJson();
I already have installed NewtonSoft in my startup project.
You need also to install Microsoft.AspNetCore.Mvc.NewtonsoftJson which contains corresponding extension methods, as written in the docs .