I have failed to setup a project as instructed here:
https://docs.telerik.com/reporting/html5-report-viewer-asp-net-core-2
I have been over the instructions 10 times, the error message I receive is.
Error registering the viewer with the service.
An error has occurred.
The type initializer for 'Lock' threw an exception.
Project found here:
https://www.dropbox.com/s/8rl4hhanj5gbfc9/WebApplication2.zip?dl=0
8 Answers, 1 is accepted
The project you attached targets .NET Core framework. Telerik Reporting .NET Core packages are built against full .NET Framework because the Reporting engine relies on the GDI+ API.
To create the .NET Core project that will host the REST service:
1. In the New Project dialog, expand Installed > Visual C# > .NET Core, and select ASP.NET Core Web Application project template. Choose a name for the project and click OK.
2. On the New ASP.NET Core Web Application dialog select from the drop downs .NET Framework and ASP.NET Core 2. Next from the list of templates select Web API.
You can check HTML5 Report Viewer in ASP.NET Core 2 help article for further instructions on how to host the service and add HTML5 Viewer to this type of projects.
If you wish to target non-Windows platforms with ASP.NET Core Application you can add HTML5 Viewer as a JavaScript widget which does not require any Telerik NuGet packages. Reporting REST service can be hosted separately in a MVC 5 project where the HTML5 Viewer will need the address of the service to display reports produced on the remote machine. More details on how to host Reporting REST Service can be found in the following help articles:
How To: Add Telerik Reporting REST Web API to Web Application
How To: Self Host Telerik Reporting REST Web API.
I hope this information will help.
Regards,
Katia
Progress Telerik

I cannot change the target framework to the .net framework unfortunately due to other company reasons.
So are you saying there is no way at all to display a Telerik report in a .net core targeted app. Even with a separate class library or Rest service?
In your current project you can add just HTML5 Viewer, it does not require any NuGet packages and will need only the address of the Reporting REST service set as its serviceUrl option. The service can be hosted in a separate project that targets the standard framework. For more details on how to host the service check:
How To: Add Telerik Reporting REST Web API to Web Application
How To: Self Host Telerik Reporting REST Web API.
Important: when the service is hosted in a separate project it is necessary to enable CORS to allow the communication between the viewer and the service.
Regards,
Katia
Progress Telerik

I have created an app which targets the .NETCORE 2 Framework. It uses a Rest Service for the reporting side. The rest service has CORS enabled as you mentioned and the .netcore project simply has the html 5 viewer.
I am getting this error:
Error loading the report viewer's templates. (Template = http://localhost:12345/api/reports/resources/templates/telerikReportViewerTemplate-html).
Even though if I click the above link the template is loaded.
Please can you amend the project I have provided to work.
*link removed due to sensitive information*


when i use Telerik reporting with .net core with core 2.0. below error
Error registering the viewer with the service.
An error has occurred.
The type initializer for 'Lock' threw an exception.
We replied to your question in your private support thread. I will also copy this answer here if anyone else is facing the same issue:
The provided web application is unable to access the Reporting REST Service due to CORS issues: screenshot.
We followed the articles provided previously and modified the Global.asax and WebApiConfig files, together with the ReportsController file accordingly. Then, starting both projects simultaneously, the viewer showed up as expected: screenshot.
@Bollini
The error message is different in your scenario. Please open a separate support ticket where you can provide additional information/samples.
Regards,
Nasko
Progress Telerik

Note that when enabling cors like so:
[EnableCors(origins:
"http://localhost:49906"
, headers:
"*"
, methods:
"*"
)]
public
class
ReportsController : ReportsControllerBase
A complete clean and rebuild of the project is required to push the changes.