JsonResult.SerializerSettings Must Be of Type Newtonsoft.Json.JsonSerializerSettings
Environment
| Product | Progress® Telerik® Reporting |
| Product Version | 20.0.26.211+ |
| Target Framework | .NET 8+ |
Description
I have updated my project to the Progress® Telerik® Reporting 2026 Q1(20.0.26.211) release, and when I try to open the Web Report Designer or any of the web-based Report Viewers, I see the mentioned error in the console.
Error Message
System.InvalidOperationException: Property 'JsonResult.SerializerSettings' must be an instance of type 'Newtonsoft.Json.JsonSerializerSettings'.
at Microsoft.AspNetCore.Mvc.NewtonsoftJson.NewtonsoftJsonResultExecutor.GetSerializerSettings(JsonResult result)
at Microsoft.AspNetCore.Mvc.NewtonsoftJson.NewtonsoftJsonResultExecutor.ExecuteAsync(ActionContext context, JsonResult result)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Cause
Starting with the Progress® Telerik® Reporting 2026 Q1 release, the .NET-based Reporting services now use System.Text.Json.
This means that the previously required extension method - AddNewtonsoftJson(), now breaks the Reporting REST Services, as it will override the default System.Text.Json serializer.
Solution
Case 1 - Remove NewtonsoftJson
If NewtonsoftJson is used only in the Reporting-related controllers, you can remove the AddNewtonsoftJson() extension method call from the project's Program.cs/Startup.cs file:
-
From
C#builder.Services.AddControllers().AddNewtonsoftJson(); -
To
C#builder.Services.AddControllers();
Case 2 - Keep NewtonsoftJson Globally
If you need to keep the NewtonsoftJson because it is used in other controllers in the project, you can remove the Reporting controllers, and you can instead implement the Telerik Reporing Service as a minimal API.
Please refer to the Hosting the Reporting REST Service in ASP.NET Core with Minimal API article for instructions on how to do that.
Our Reporting REST Service will use System.Text.Json despite that. This approach only allows to keep using NewtonsoftJson globally in the project without affecting the reporting service.
Case 3 - Use NewtonsoftJson Locally in Specific Controllers
If you have overridden any of the methods of the Reporting controller, then the minimal API approach is not a viable option.
In this case, you would need to remove NewtonsoftJson globally, and use it only locally in specific controllers using the approach from the Serializing with both 'System.Text.Json' and 'Newtonsoft.Json' in the same ASP.NET Core project article.