Hi,
I have a .Net 5.0 RC2 Blazor WebAssembly application with System.Text.Json as json de/serialization support. I configured server project to serve reports, but I receive the error:
Property 'JsonResult.SerializerSettings' must be an instance of type 'System.Text.Json.JsonSerializerOptions'.
It is obvious that the error appears because the NewtonsoftJson package is missing - but I don't want to replace System.Text.Json de/serializing mechanism. The question is: is there a way to override/provide the json serializer settings and to skip this issue?
Thanks,
Ion
3 Answers, 1 is accepted
Hi Ion,
We still don't support .NET 5, so we haven't tested the compatibility with Telerik Reporting. However, the error message you observed is very familiar. I observed a similar error when moving from .NET Core 2 to .NET Core 3 and it was related to a missing call to AddNewtonsoftJson(). The issue and the solution are described here, although I am not 100% sure the same solution is applicable to .NET 5. We have just started development of the .NET 5 support and plan to release it in the next official release. I will include the support for the Blazor WebAssembly scenario in the feature specifications.
Regards,
Nasko
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hi Nasko,
Thanks for reply!
Any chance for the next release before the end of the year? I have a project under development having many reports, and I don't want to downgrade to NewtonsoftJson, which was officially replaced in .Net5, but I can delay the reporting development for 1-2 months, if needed.
Thanks!

Hi,
After digging a bit, I found a workaround:
1. Add a new WebAPI project targeting .Net core 3.1 in solution
2. Enable CORS in Startup class
3. Move the Telerik.Reporting.Services.AspNetCore package, the ReportsController and the Reports folder here
4. Change the index.html in WebAssembly application to point the js files: <script src="http://{new_report_api_url}/api/reports/resources/js/telerikReportViewer"></script>
It is a temporary solution, which allows development until .Net 5 Json support will be added, but at least it works.
Has .Net 5 Json support been added or is this still the recommended workaround?
In the workaround, does is the WebAPI a separate website that must be setup?
Thanks,
Tim
Hi Tim,
Since R1 2021, we provide .NET5 support for our viewers and REST service. You can check our .NET5 demos that can be found in the installation folder of Telerik Reporting
C:\Program Files (x86)\Progress\Telerik Reporting R2 2021\Examples\CSharp\.NET 5\
I think the question was about the System.Text.Json support and the dependency that Telerik Reporting has on NewtonsoftJson.
My understanting is that Microsoft is pushing System.Text.Json (faster and part of .net 5/6). Telerik Reporting still needs NewtonsoftJson to work creating "problems", especially in Blazor world where DTO from Telerik (Telerik.DataSource) need System.Text.Json, see Adding Reporting or Newtonsoft.Json breaks DataSourceRequest filters sending to the server | Telerik UI for Blazor or Chart not working with Newtonsoft.Json serialization properties | Telerik UI for Blazor.
Is there any news on when or if TelerikReporting will support System.Text.Json instead of Newtonsoft.Json?
Hi Constantinos,
Тhere is currently a feature request about migrating to System.Text.Json that you may vote for to increase its priority - Migrate to System.Text.Json for serialization, instead of using Newtonsoft.Json. In the FR, there is also an admin edit explaining possible workarounds so that you may use Newtonsoft only for our service and thus not break the rest of the project.