This is a migrated thread and some comments may be shown as answers.

ASP .NET Core 2.0 Issue with Reporting

9 Answers 770 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pierre-Andre van Leeuwen
Top achievements
Rank 1
Pierre-Andre van Leeuwen asked on 23 Jan 2018, 09:10 AM

I am getting the following error:

System.TypeInitializationException
  HResult=0x80131534
  Message=The type initializer for 'Lock' threw an exception.
  Source=Telerik.Reporting
  StackTrace:
   at Telerik.Reporting.Cache.CacheStorage.Lock..ctor(String key)
Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'System.Threading.AccessControl, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

The current packages installed from my .csproj file:

<PackageReference Include="HangFire" Version="1.6.17" />
    <PackageReference Include="KendoUICore" Version="2018.1.117" />
    <PackageReference Include="KendoUIProfessional" Version="2018.1.117" />
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1" />
    <PackageReference Include="Microsoft.Net.Http" Version="2.2.29" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.2" />
    <PackageReference Include="Moq" Version="4.8.1" />
    <PackageReference Include="Newtonsoft.Json" Version="11.0.1-beta3" />
    <PackageReference Include="System.Net.Requests" Version="4.3.0" />
    <PackageReference Include="Telerik.Reporting" Version="12.0.18.117" />
    <PackageReference Include="Telerik.Reporting.Services.AspNetCore" Version="12.0.18.117" />
    <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2018.1.117" />

9 Answers, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 26 Jan 2018, 07:19 AM
Hi Pierre-Andre,

Such errors occur when the Telerik Reporting NuGet packages are not compatible with the project. The packages are built against the full .NET Framework because the Reporting engine relies on the GDI+ API. Therefore, the packages will not work in the project that targets .NET Core framework as GDI+ is missing there.

If you wish to use the packages in .NET Core project use the following steps for creating the project:

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.

It is important to select .NET Framework from the drop down on the second step as this will set full .NET framework as the target framework of the project. For more details check HTML5 Report Viewer in ASP.NET Core 2 help article.

If the above requirement cannot be met you can add just HTML5 Viewer in the project as it does not require any NuGet packages. Reporting REST service can be hosted separately in a project that targets full .NET framework. HTML5 Viewer will only need the address of the service set as its serviceUrl option. 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


When the service and the viewer are hosted in different domains it will be required to enable CORS in order to enable communication between the viewer and the service.


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Scott
Top achievements
Rank 1
answered on 25 Feb 2018, 07:51 PM
I am building a proof of concept for report generation (programmatically generating and saving to pdf utilizing objectdatasource) with AWS Lambda, I am using dotnetcore 2.0. There is no way to target full framework. It seems like I will have to look into other reporting packages. I would like to see you guys build a version that runs on dotnet core 2.0. Maybe you can look into utilizing the new System.Drawing.Common 4.5.0-preview package that includes libgdiplus on non-windows machines.
0
Katia
Telerik team
answered on 28 Feb 2018, 02:44 PM
Hello Scott,

Thank you for your suggestion. We receive an increasing amount of requests from our community related to rendering of reports on non-Windows machines. We are monitoring the available tools and libraries which we can switch to in order to provide such support. However, the task is still not clear and it will definitely take a considerable amount of time an resources to implement it.

Feel free to share your ideas in the comments for REST Report service exposing the report generation engine on Linux request logged into our feedback portal. This will help us to measure the demand for this feature, see what is expected from it and to decide if we need to move forward in this direction.


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Kasun
Top achievements
Rank 1
answered on 20 Apr 2018, 05:18 PM
Is this still valid? Can we add Telerik reporting into a .NET Core Rest Service? 
0
Katia
Telerik team
answered on 24 Apr 2018, 12:58 PM
Hello Kasun,

The requirements for adding Telerik Reporting NuGet packages into a .NET Core project have not changed. The project needs to target full .NET Framework as the packages are built against it.

If the project needs to target .NET Core framework you can add just HTML5 Viewer in it and host the service in a separate project that targets full .NET framework. More details on hosting the service are provided in:
How To: Add Telerik Reporting REST Web API to Web Application 
How To: Self Host Telerik Reporting REST Web API


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stephen
Top achievements
Rank 1
answered on 01 Oct 2019, 05:10 PM
Looking into the option for report generation within AWS Lambda as Scott had asked back in Feb of 2018.  By chance has the requirement for the targeting the full .Net Framework changed?
0
Neli
Telerik team
answered on 04 Oct 2019, 11:12 AM

Hi Stephen,

Since version R1 2019, we provide .NET Core Support. Note that we support reports that are designed in the Standalone designer as well as reports created in Visual Studio Report designer without code specific for CodeDOM classes like ResourceManager. You may find step-by-step instructions for setting-up .NET Core projects in the following articles:

Regards,
Neli
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Scott Waye
Top achievements
Rank 2
Veteran
Iron
commented on 28 Jun 2022, 09:26 PM

Sadly, both "How To" links are dead.
Neli
Telerik team
commented on 01 Jul 2022, 12:24 PM

Hi Scot,

I have just checked and it seems that the links are working on my end. Can you please test again?

Scott Waye
Top achievements
Rank 2
Veteran
Iron
commented on 01 Jul 2022, 12:25 PM | edited

Both give

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

 

For me.

link is  https://docs.telerik.com/reporting/manual-setup-of-html5-report-viewer-in-asp-net-core-3?_ga=2.96293080.557661349.1656629100-696432566.1640292988

Neli
Telerik team
commented on 01 Jul 2022, 12:46 PM

Hi Scott,

If I understood correctly, you would like to use Telerik Reporting in .NET Core 3.0 application. Note that this version of .NET core was deprecated on the 3rd of March 2020.I would recommend checking the How to Use HTML5 Report Viewer in an ASP.NET Core 3.1 application article.

Let me know if I can assist you further.

Scott Waye
Top achievements
Rank 2
Veteran
Iron
commented on 01 Jul 2022, 02:28 PM

No, we use .Net 6.  I was just commenting that the links were dead.  No big deal.
Neli
Telerik team
commented on 06 Jul 2022, 10:03 AM

Hi Scott,

For .NET6, you can take a look at the How to Host Reports Service in ASP.NET Core in .NET 6 with Minimal API article.

0
Stephen
Top achievements
Rank 1
answered on 07 Oct 2019, 06:44 PM

Hi Neli,

Thanks for the response.  Attempting to add a report to a .NET Core 2.2 project via the "Add -> New Item" I am not finding the Telerik templates as an option.(reference capture.png)  When I do the same thing via a .NET Framework 4.7.2 it works as expected and I am able to add the report to the project (reference capture-full framework.png).

When the .NET Core 2.2 project references a report created in a .NET Framework application I am receiving a run-time exception (reference capture-runtime-issue.png).

Might be two problems here.  I can easily provide the example projects if necessary. Cheers!

0
Stephen
Top achievements
Rank 1
answered on 07 Oct 2019, 07:14 PM
Disregard my previous post.. found this posting https://docs.telerik.com/reporting/knowledge-base/use-existing-report-library-in-net-core-app which covers the problem.
Tags
General Discussions
Asked by
Pierre-Andre van Leeuwen
Top achievements
Rank 1
Answers by
Katia
Telerik team
Scott
Top achievements
Rank 1
Kasun
Top achievements
Rank 1
Stephen
Top achievements
Rank 1
Neli
Telerik team
Share this question
or