Blazor app with WebReportDesigner CSharp.Net8.BlazorIntegrationDemo - ASPNETCORE_ENVIRONMENT other than Development

1 Answer 18 Views
.NET Core Report Designer - Web Report Viewer - Blazor
Sergii
Top achievements
Rank 1
Iron
Iron
Sergii asked on 15 Sep 2025, 10:39 AM
Hi,

there probably an issue with ASPNETCORE_ENVIRONMENT for WebReportDesigner: can't apply anything than "Development".

Steps to reproduce:

Have installed Telerik_Reporting_2025_Q3_19_2_25_813.msi in order to have installed Examples.

In Examples find out

"\CSharp\.NET 8\BlazorIntegrationDemo"

in CSharp\.NET 8\BlazorIntegrationDemo\Properties\launchSettings.json
clone section CSharp.Net8.BlazorIntegrationDemo as CSharp.Net8.BlazorIntegrationDemo.Development.Test, where change

"ASPNETCORE_ENVIRONMENT": "Development" -> "ASPNETCORE_ENVIRONMENT": "Development.Test"

you should get something like:
---
    "CSharp.Net8.BlazorIntegrationDemo.Development.Test": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development.Test"
      },
      "applicationUrl": "http://localhost:57349"
    }
---

profile CSharp.Net8.BlazorIntegrationDemo still works, but when I run for profile CSharp.Net8.BlazorIntegrationDemo.Development.Test I get 
---
Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Could not find 'telerikReportViewerInterop.createReportViewerWidget' ('telerikReportViewerInterop' was undefined).
Error: Could not find 'telerikReportViewerInterop.createReportViewerWidget' ('telerikReportViewerInterop' was undefined).
    at http://localhost:57339/_framework/blazor.web.js:1:537
    at Array.forEach (<anonymous>)
    at l.findFunction (http://localhost:57339/_framework/blazor.web.js:1:505)
    at b (http://localhost:57339/_framework/blazor.web.js:1:5248)
    at http://localhost:57339/_framework/blazor.web.js:1:3041
    at new Promise (<anonymous>)
    at y.beginInvokeJSFromDotNet (http://localhost:57339/_framework/blazor.web.js:1:3004)
    at gn._invokeClientMethod (http://localhost:57339/_framework/blazor.web.js:1:62730)
    at gn._processIncomingData (http://localhost:57339/_framework/blazor.web.js:1:60119)
    at connection.onreceive (http://localhost:57339/_framework/blazor.web.js:1:53760)
---

1 Answer, 1 is accepted

Sort by
1
Accepted
Ivet
Telerik team
answered on 18 Sep 2025, 08:58 AM

Hi Sergii,

Thank you for the detailed description of the scenario.

The error occurs because the Report Viewer’s required JavaScript interop file (telerikReportViewerInterop.js) is not loaded when you use a custom ASPNETCORE_ENVIRONMENT value such as "Development.Test". This seems to be a default behavior for static web assets in Blazor.

If the environment name is changed, scripts and other static resources might not be included or served, resulting in missing interop functions.

Make sure builder.WebHost.UseStaticWebAssets(); is always called in your Program.cs or Startup.cs, regardless of the environment. This ensures static resources are served in all configurations.

Open your _Host.cshtml(or the shared file for your Blazor application) and confirm that the telerikReportViewerInterop reference is present and not wrapped in any environment-specific logic. The script should be included unconditionally for every environment.

You might also find the following Knowledge Base article helpful in resolving the issue - telerikReportViewerInterop was undefined - Telerik Reporting.

I hope the above information will be useful. Let me know if you have other questions.

    Regards,
    Ivet
    Progress Telerik

    Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

    Sergii
    Top achievements
    Rank 1
    Iron
    Iron
    commented on 18 Sep 2025, 10:57 AM | edited

     

     

    Thank you very much, Ivet!

     

     

     

    probably would be great if line

    builder.WebHost.UseStaticWebAssets();

    would be added into Examples

    Tags
    .NET Core Report Designer - Web Report Viewer - Blazor
    Asked by
    Sergii
    Top achievements
    Rank 1
    Iron
    Iron
    Answers by
    Ivet
    Telerik team
    Share this question
    or