I upgraded an existing ASP.NET Core 2.2 project to 3.0. I have a method that returns JSON which worked in 2.2, but in 3.0, it causes \"The collection type \'Newtonsoft.Json.Linq
In .NET Core 3.1 based web applications if you are getting this error, the Nuget package you need to have is the same "Microsoft.AspNetCore.Mvc.NewtonsoftJson".
The code in the ConfigureServices method in the Startup class would look like
services.AddControllersWithViews().AddNewtonsoftJson();
Refer this link