New to Telerik Reporting? Start a free 30-day trial
JSONResult.SerializerSettings Must Be of Type System.Text.Json.JsonSerializerOptions
Environment
| Product Version | 14.0.20.219+ |
| Product | Progress® Telerik® Reporting |
| .NET Framework | .NET Core 3.0+ / .NET 5+ |
Description
Starting with version
20.0.26.211, the .NET-based Reporting services now useSystem.Text.Json.
If you are using version20.0.26.211or later, and encounter a similar exception, take a look at the JsonResult.SerializerSettings Must Be of Type Newtonsoft.Json.JsonSerializerSettings article instead.
If the Telerik Reporting REST Service project is targeting .NET Core 3.0+(or .NET 5+) and is throwing the error JSONResult.SerializerSettings Must Be of Type System.Text.Json.JsonSerializerOptions
Solution
-
Add the NuGet Package,
Microsoft.AspNetCore.Mvc.NewtonsoftJson -
Append
.AddNewtonsoftJson()to any of the following services configurations:C#services.AddControllers().AddNewtonsoftJson();C#services.AddControllersWithViews().AddNewtonsoftJson();C#services.AddRazorPages().AddNewtonsoftJson();