-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
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
#appdiv 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.jsloads ✓- 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
TrimmerRootAssemblyfor 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