Skip to content

[iOS] BlazorWebView components not rendering on .NET 10 - Blazor starts but RootComponent is not injected into DOM #32894

@spanglerp

Description

@spanglerp

Description

BlazorWebView on iOS (.NET 10) starts Blazor successfully, but the RootComponent is never rendered into the DOM. The #app element remains unchanged. This works correctly on Android with the same codebase.

Steps to Reproduce

  1. Create a .NET 10 MAUI Blazor Hybrid app
  2. Build for iOS with dotnet publish -f net10.0-ios -c Release
  3. Install and run on iOS device
  4. Observe that Blazor starts (confirmed via JavaScript: Blazor.start() throws "Blazor has already started")
  5. But the RootComponent is never rendered - the #app div stays empty

Expected Behavior

The Blazor component registered in MainPage.xaml should render into the #app element.

Actual Behavior

  • HTML loads correctly ✓
  • JavaScript executes ✓
  • blazor.webview.js loads ✓
  • Blazor starts automatically ✓
  • But RootComponent is NOT rendered

The #app div remains unchanged. Even a minimal component with just <h1>Test</h1> (no code) does not render.

Environment

  • .NET SDK: 10.0.100
  • Microsoft.Maui.Controls: 10.0.10
  • Microsoft.AspNetCore.Components.WebView.Maui: 10.0.10
  • Target: iOS 17.0+
  • Device: iPhone (physical device)
  • Build: Release with AOT

Workarounds Attempted (all failed)

  • Disabled AOT (PublishAot=false, UseInterpreter=true)
  • Disabled trimming (MtouchLink=None) - app crashes
  • Added TrimmerRootAssembly for Maui assembly
  • Programmatically added RootComponent in code-behind
  • Simplified component to just HTML (no @code block)
  • Removed all external CSS/JS references

Additional Context

The same app works on Android. The issue appears to be iOS-specific in .NET 10.

Build output shows many trim warnings related to Blazor components:

Trim analysis warning IL2111: Method 'Microsoft.AspNetCore.Components.Routing.Router.NotFoundPage.set' with parameters or return value with DynamicallyAccessedMembersAttribute is accessed via reflection.

Link to public reproduction project repository

https://github.com/spanglerp/maui-blazor-ios-bug

Version with bug

10.0.10

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

10.0.10

Affected platforms

iOS

Affected platform versions

IOS 26

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorBlazor Hybrid / Desktop, BlazorWebViewi/regressionThis issue described a confirmed regression on a currently supported versionp/0Current heighest priority issues that we are targeting for a release.regressed-in-10.0.0t/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions