If you are using NewtonsoftJson, make sure to add Nuget package reference to Microsoft.AspNetCore.Mvc.NewtonsoftJson also.