Skip to content

dotnet publish fails with Mono assertion when using new InteractiveWebAssemblyRenderMode(prerender: false) #64302

@Neth01

Description

@Neth01

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

After modifying App.razor to use InteractiveWebAssemblyRenderMode on HeadOutlet and Routes, a published Blazor WebAssembly app (built with dotnet publish) fails at runtime with a Mono assertion:

[MONO] * Assertion at /__w/1/s/src/runtime/src/mono/mono/metadata/assembly.c:2718, condition `<disabled>' not met

Expected Behavior

The published WebAssembly app runs normally in the browser.

Steps To Reproduce

  1. Create a new Blazor WebAssembly app:
dotnet new blazor --interactivity WebAssembly --all-interactive --no-https
  1. Edit BlazorBug/Components/App.razor and change the HeadOutlet and Routes lines to:
<HeadOutlet @rendermode="new InteractiveWebAssemblyRenderMode(prerender: false)" />
...
<Routes @rendermode="new InteractiveWebAssemblyRenderMode(prerender: false)" />
  1. Publish the app:
dotnet publish -c Release
  1. Open the published app in a browser and check the developer console.

Exceptions (if any)

The browser console shows a Mono runtime assertion and the app fails to run. Example message:

dotnet.runtime.fn94ls2wwa.js:3  [MONO] * Assertion at /__w/1/s/src/runtime/src/mono/mono/metadata/assembly.c:2718, condition `<disabled>' not met

.NET Version

.NET SDK: 10.0.100-rc.2.25502.107 or .NET SDK: 9.0.306

Anything else?

  • OS: Windows 11

Example project

BlazorBug.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.Status: Resolvedarea-blazorIncludes: Blazor, Razor Componentsquestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions