ASP .NET Core 2.0 Issue with Reporting

6 posts, 0 answers
  1. Pierre-Andre van Leeuwen
    Pierre-Andre van Leeuwen avatar
    13 posts
    Member since:
    Feb 2010

    Posted 23 Jan 2018 Link to this post

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

  2. Katia
    Admin
    Katia avatar
    693 posts

    Posted 26 Jan 2018 Link to this post

    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
  3. Scott
    Scott avatar
    1 posts
    Member since:
    Jun 2012

    Posted 25 Feb 2018 Link to this post

    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.
  4. Katia
    Admin
    Katia avatar
    693 posts

    Posted 28 Feb 2018 Link to this post

    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
  5. Kasun
    Kasun avatar
    22 posts
    Member since:
    Oct 2016

    Posted 20 Apr 2018 Link to this post

    Is this still valid? Can we add Telerik reporting into a .NET Core Rest Service? 
  6. Katia
    Admin
    Katia avatar
    693 posts

    Posted 24 Apr 2018 Link to this post

    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
Back to Top