This is a migrated thread and some comments may be shown as answers.
.Net Core RC2 Json problem
3 Answers 25 Views
This is a migrated thread and some comments may be shown as answers.
Ion
Top achievements
Rank 1
Ion asked on 21 Oct 2020, 08:58 PM

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

Sort by
0
Nasko
Telerik team
answered on 26 Oct 2020, 07:06 PM

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/.

0
Ion
Top achievements
Rank 1
answered on 27 Oct 2020, 07:13 AM

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!

0
Ion
Top achievements
Rank 1
answered on 29 Oct 2020, 07:41 AM

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.

Asked by
Ion
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Ion
Top achievements
Rank 1
Share this question
or