From 6586901e0cb8c09f062d9888d2a09b0ab19a48ac Mon Sep 17 00:00:00 2001 From: guardrex <1622880+guardrex@users.noreply.github.com> Date: Mon, 1 Dec 2025 07:12:41 -0500 Subject: [PATCH 1/2] Additional Blazor script coverage and fix comments --- aspnetcore/blazor/components/integration.md | 12 ++++++++++++ aspnetcore/blazor/project-structure.md | 16 ++++++++-------- .../aspnetcore-10/includes/blazor.md | 6 ++++++ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/aspnetcore/blazor/components/integration.md b/aspnetcore/blazor/components/integration.md index 15830b17f28f..c7070a385b14 100644 --- a/aspnetcore/blazor/components/integration.md +++ b/aspnetcore/blazor/components/integration.md @@ -179,6 +179,12 @@ To support routable Razor components in Razor Pages apps: > [!NOTE] > The preceding example assumes that the component and Blazor script (`_framework/blazor.server.js`) are rendered by the app's layout. For more information, see the [Configuration](#configuration) section. + > + > In .NET 10 or later, the Blazor script is included by the framework if the project contains at least one Razor component file (`.razor`). If your app requires the Blazor script but doesn't contain at least one component, add the following MSBuild property to the app's project file to force unconditional script inclusion: + > + > ```xml + > true + > ``` configures whether the `App` component: @@ -260,6 +266,12 @@ To support routable Razor components in MVC apps: > [!NOTE] > The preceding example assumes that the component and Blazor script (`_framework/blazor.server.js`) are rendered by the app's layout. For more information, see the [Configuration](#configuration) section. + > + > In .NET 10 or later, the Blazor script is included by the framework if the project contains at least one Razor component file (`.razor`). If your app requires the Blazor script but doesn't contain at least one component, add the following MSBuild property to the app's project file to force unconditional script inclusion: + > + > ```xml + > true + > ``` configures whether the `App` component: diff --git a/aspnetcore/blazor/project-structure.md b/aspnetcore/blazor/project-structure.md index 41502429aa01..67524e3d2d5b 100644 --- a/aspnetcore/blazor/project-structure.md +++ b/aspnetcore/blazor/project-structure.md @@ -70,11 +70,11 @@ The `Components/Pages` folder of the server project contains the app's routable Add the angle brackets around the cross-link when activating. -:::moniker range=">= aspnetcore-10.0" +moniker range=">= aspnetcore-10.0" The `NotFound` component (`NotFound.razor`) implements a Not Found page to display when content isn't found for a request path. For more information, see xref:blazor/fundamentals/navigation#not-found-responses. -:::moniker-end +moniker-end --> @@ -332,9 +332,9 @@ Project structure: Add the angle brackets around the cross-link when activating. -:::moniker-end +moniker-end -:::moniker range=">= aspnetcore-10.0" +moniker range=">= aspnetcore-10.0" * `Pages` folder: Contains the Blazor app's routable Razor components (`.razor`). The route for each page is specified using the [`@page`](xref:mvc/views/razor#page) directive. The template includes the following components: * `Counter` component (`Counter.razor`): Implements the Counter page. @@ -342,9 +342,9 @@ Project structure: * `Weather` component (`Weather.razor`): Implements the Weather page. * `NotFound` component (`NotFound.razor`) Implements a Not Found page to display when content isn't found for a request path. For more information, see xref:blazor/fundamentals/navigation#not-found-responses. -:::moniker-end +moniker-end -:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0" +moniker range=">= aspnetcore-8.0 < aspnetcore-10.0" --> @@ -357,9 +357,9 @@ Project structure: https://github.com/dotnet/AspNetCore.Docs/pull/36145 is merged. -:::moniker-end +moniker-end -:::moniker range=">= aspnetcore-8.0" +moniker range=">= aspnetcore-8.0" --> diff --git a/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md b/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md index 65a17c54b44a..915ca898a690 100644 --- a/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md +++ b/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md @@ -36,6 +36,12 @@ For more information, see true +``` + For more information, see the following resources: * From 96ef3c04cf3c657234f1bd6598e6c73b5972184e Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Mon, 1 Dec 2025 07:25:39 -0500 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- aspnetcore/blazor/components/integration.md | 4 ++-- aspnetcore/release-notes/aspnetcore-10/includes/blazor.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/blazor/components/integration.md b/aspnetcore/blazor/components/integration.md index c7070a385b14..2dad9cc2c506 100644 --- a/aspnetcore/blazor/components/integration.md +++ b/aspnetcore/blazor/components/integration.md @@ -183,7 +183,7 @@ To support routable Razor components in Razor Pages apps: > In .NET 10 or later, the Blazor script is included by the framework if the project contains at least one Razor component file (`.razor`). If your app requires the Blazor script but doesn't contain at least one component, add the following MSBuild property to the app's project file to force unconditional script inclusion: > > ```xml - > true + > true > ``` configures whether the `App` component: @@ -270,7 +270,7 @@ To support routable Razor components in MVC apps: > In .NET 10 or later, the Blazor script is included by the framework if the project contains at least one Razor component file (`.razor`). If your app requires the Blazor script but doesn't contain at least one component, add the following MSBuild property to the app's project file to force unconditional script inclusion: > > ```xml - > true + > true > ``` configures whether the `App` component: diff --git a/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md b/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md index 915ca898a690..1ef80c1dd8b9 100644 --- a/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md +++ b/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md @@ -39,7 +39,7 @@ In prior releases of .NET, the Blazor script is served from an embedded resource The Blazor script (`blazor.web.js` or `blazor.server.js`) is included by the framework if the project contains at least one Razor component file (`.razor`). If your app requires the Blazor script but doesn't contain at least one component, add the following MSBuild property to the app's project file to force unconditional script inclusion: ```xml -true +true ``` For more information, see the following resources: