Skip to content

Commit 8fc8049

Browse files
authored
Update MAUI Blazor Hybrid app with BWA tutorial (#36384)
1 parent 8504073 commit 8fc8049

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

aspnetcore/blazor/hybrid/tutorials/maui-blazor-web-app.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to build a .NET MAUI Blazor Hybrid app with a Blazor Web
55
monikerRange: '>= aspnetcore-8.0'
66
ms.author: wpickett
77
ms.custom: mvc
8-
ms.date: 11/11/2025
8+
ms.date: 11/21/2025
99
uid: blazor/hybrid/tutorials/maui-blazor-web-app
1010
---
1111
# Build a .NET MAUI Blazor Hybrid app with a Blazor Web App
@@ -51,14 +51,18 @@ The preceding command produces a Blazor app that adopts global interactivity, wh
5151

5252
:::moniker-end
5353

54-
:::moniker range="< aspnetcore-9.0"
54+
:::moniker range="< aspnetcore-10.0"
5555

5656
## .NET MAUI Blazor Hybrid and Web App sample app
5757

58-
[Obtain the sample app](xref:blazor/fundamentals/index#sample-apps) named `MauiBlazorWeb` from the [Blazor samples GitHub repository (`dotnet/blazor-samples`)](https://github.com/dotnet/blazor-samples) (.NET 8 or later).
58+
[Obtain the sample app](xref:blazor/fundamentals/index#sample-apps) named `MauiBlazorWeb` from the [Blazor samples GitHub repository (`dotnet/blazor-samples`)](https://github.com/dotnet/blazor-samples) (`8.0` or `9.0` folder).
5959

6060
The sample app is a starter solution that contains a .NET MAUI Blazor Hybrid (native, cross-platform) app, a Blazor Web App, and a Razor class library (RCL) that contains the shared UI (Razor components) used by the native and web apps.
6161

62+
:::moniker-end
63+
64+
:::moniker range="< aspnetcore-9.0"
65+
6266
## Migrating a .NET MAUI Blazor Hybrid solution
6367

6468
Instead of [using the sample app](#net-maui-blazor-hybrid-and-web-app-sample-app), you can migrate an existing .NET MAUI Blazor Hybrid app with the guidance in this section using Visual Studio.
@@ -197,6 +201,9 @@ Render mode specification subsections:
197201

198202
* [Global Server interactivity](#global-server-interactivity)
199203
* [Global Auto or WebAssembly interactivity](#global-auto-or-webassembly-interactivity)
204+
* [Per-page/component Server interactivity](#per-pagecomponent-server-interactivity)
205+
* [Per-page/component Auto interactivity](#per-pagecomponent-auto-interactivity)
206+
* [Per-page/component WebAssembly interactivity](#per-pagecomponent-webassembly-interactivity)
200207

201208
:::moniker-end
202209

@@ -382,6 +389,24 @@ Project references:
382389

383390
Add the following <xref:Microsoft.AspNetCore.Components.Routing.Router.AdditionalAssemblies%2A> parameter to the `Router` component instance for the `MauiBlazorWeb.Shared.Client` project assembly (via its `_Imports` file) in the `MauiBlazorWeb.Shared` project's `Routes.razor` file:
384391

392+
:::moniker-end
393+
394+
:::moniker range=">= aspnetcore-10.0"
395+
396+
```razor
397+
<Router AppAssembly="@typeof(Routes).Assembly" NotFoundPage="typeof(Pages.NotFound)"
398+
AdditionalAssemblies="new [] { typeof(MauiBlazorWeb.Shared.Client._Imports).Assembly }">
399+
<Found Context="routeData">
400+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Components.Layout.MainLayout)" />
401+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
402+
</Found>
403+
</Router>
404+
```
405+
406+
:::moniker-end
407+
408+
:::moniker range=">= aspnetcore-9.0 < aspnetcore-10.0"
409+
385410
```razor
386411
<Router AppAssembly="@typeof(Routes).Assembly"
387412
AdditionalAssemblies="new [] { typeof(MauiBlazorWeb.Shared.Client._Imports).Assembly }">
@@ -392,6 +417,10 @@ Add the following <xref:Microsoft.AspNetCore.Components.Routing.Router.Additiona
392417
</Router>
393418
```
394419

420+
:::moniker-end
421+
422+
:::moniker range=">= aspnetcore-9.0"
423+
395424
Add the `MauiBlazorWeb.Shared.Client` project assembly (via its `_Imports` file) with the following <xref:Microsoft.AspNetCore.Builder.RazorComponentsEndpointConventionBuilderExtensions.AddAdditionalAssemblies%2A> call in the `MauiBlazorWeb.Web` project's `Program.cs` file:
396425

397426
```csharp

0 commit comments

Comments
 (0)