this can happen due to version conflicts or missing dependencies for kindly check following #1 check your csproj file and ensure that there are no conflicting versions for the Microsoft.AspNetCore.Mvc.Formatters.Json #2 if there is any existing dependencies for Microsoft.AspNetCore.Mvc.Formatters.Json then remove the dependency.