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
- Create a .NET 10 MAUI Blazor Hybrid app
- Build for iOS with
dotnet publish -f net10.0-ios -c Release
- Install and run on iOS device
- Observe that Blazor starts (confirmed via JavaScript:
Blazor.start() throws "Blazor has already started")
- 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
Description
BlazorWebView on iOS (.NET 10) starts Blazor successfully, but the RootComponent is never rendered into the DOM. The
#appelement remains unchanged. This works correctly on Android with the same codebase.Steps to Reproduce
dotnet publish -f net10.0-ios -c ReleaseBlazor.start()throws "Blazor has already started")#appdiv stays emptyExpected Behavior
The Blazor component registered in
MainPage.xamlshould render into the#appelement.Actual Behavior
blazor.webview.jsloads ✓The
#appdiv remains unchanged. Even a minimal component with just<h1>Test</h1>(no code) does not render.Environment
Workarounds Attempted (all failed)
PublishAot=false,UseInterpreter=true)MtouchLink=None) - app crashesTrimmerRootAssemblyfor Maui assemblyAdditional 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