Skip to content

fix: CtorNotLocated exception while using progress toasts with Blazor WASM #3973

@MysteryMS

Description

@MysteryMS

🐛 Bug Report

This is a reopening of #3408 since it had no recent activities since I last commented and this issue still persists.

When compiling Web Assembly, showing a progress toast gives an unhandled exception on production builds, but not on development.

💻 Repro or Code Sample

        ToastParameters<ProgressToastContent> progressToast = new()
        {
            Intent = ToastIntent.Progress,
            Timeout = 0,
            Title = "Generating PDF",
            Content = new()
            {
                Details = "This may take a few seconds"
            }
        };
        ToastService.ShowProgressToast(progressToast);

🤔 Expected Behavior

Toast should show with no exceptions

😯 Current Behavior

Unhandled exception is thrown:
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: CtorNotLocated, Microsoft.FluentUI.AspNetCore.Components.ProgressToast

💁 Possible Solution

As stated on #3408

<PropertyGroup>
  <BlazorWebAssemblyEnableLinking>false</BlazorWebAssemblyEnableLinking>
</PropertyGroup>

However, that did not seem to take effect.

Tried also configuring the Linker with a config file:

<?xml version="1.0" encoding="UTF-8" ?>
<linker>
    <assembly fullname="Microsoft.FluentUI.AspNetCore.Components.ProgressToast">
    </assembly>
</linker>

No luck.

🔦 Context

🌍 Your Environment

  • OS & Device: Linux on PC, Ubuntu 24.04
  • Browser: Microsoft Edge, Chrome
  • .NET and Fluent UI Blazor library Version: .NET 9.0.102 and Fluent UI 4.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    community:contributionIssue will/can be addressed by community contributiondependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions