Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/doc-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Check the .NET target framework(s) being used, and include the version number(s)
* [ ] .NET Framework
* [ ] .NET Standard

If using the .NET Core SDK, include `dotnet --info` output. If using .NET Framework without the .NET Core SDK, include info from Visual Studio's **Help** > **About Microsoft Visual Studio** dialog.
If using the .NET SDK, include `dotnet --info` output. If using .NET Framework without the .NET SDK, include info from Visual Studio's **Help** > **About Microsoft Visual Studio** dialog.

<details>
<summary><strong>dotnet --info output</strong> or <strong>About VS info</strong></summary>
Expand Down
12 changes: 11 additions & 1 deletion .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@
},
{
"source_path": "aspnetcore/choose-aspnet-framework.md",
"redirect_url": "/aspnet/core/fundamentals/choose-aspnet-framework",
"redirect_url": "/aspnet/core/overview",
"redirect_document_id": false
},
{
Expand Down Expand Up @@ -1572,6 +1572,16 @@
"source_path": "aspnetcore/getting-started/index.md",
"redirect_url": "/aspnet/core/get-started",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/fundamentals/choose-aspnet-framework.md",
"redirect_url": "/aspnet/core/overview",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/introduction-to-aspnet-core.md",
"redirect_url": "/aspnet/core/overview",
"redirect_document_id": false
}
]
}
4 changes: 2 additions & 2 deletions aspnetcore/blazor/call-web-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to call a web API from Blazor apps.
monikerRange: '>= aspnetcore-3.1'
ms.author: wpickett
ms.custom: mvc
ms.date: 06/11/2025
ms.date: 07/29/2025
uid: blazor/call-web-api
---
# Call a web API from ASP.NET Core Blazor
Expand Down Expand Up @@ -61,7 +61,7 @@ In the app's `Program` file, call:

* <xref:Microsoft.Identity.Web.MicrosoftIdentityWebApiAuthenticationBuilder.EnableTokenAcquisitionToCallDownstreamApi%2A>: Enables token acquisition to call web APIs.
* `AddDownstreamApi`: Microsoft Identity Web packages provide API to create a named downstream web service for making web API calls. <xref:Microsoft.Identity.Abstractions.IDownstreamApi> is injected into a server-side class, which is used to call <xref:Microsoft.Identity.Abstractions.IDownstreamApi.CallApiForUserAsync%2A> to obtain weather data from an external web API (`MinimalApiJwt` project).
* <xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.DistributedTokenCacheAdapterExtension.AddDistributedTokenCaches%2A>: Adds the .NET Core distributed token caches to the service collection.
* <xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.DistributedTokenCacheAdapterExtension.AddDistributedTokenCaches%2A>: Adds the .NET distributed token caches to the service collection.
* <xref:Microsoft.Extensions.DependencyInjection.MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache%2A>: Adds a default implementation of <xref:Microsoft.Extensions.Caching.Distributed.IDistributedCache> that stores cache items in memory.
* Configure the distributed token cache options (<xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.MsalDistributedTokenCacheAdapterOptions>):
* In development for debugging purposes, you can disable the L1 cache by setting <xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.MsalDistributedTokenCacheAdapterOptions.DisableL1Cache%2A> to `true`. ***Be sure to reset it back to `false` for production.***
Expand Down
10 changes: 6 additions & 4 deletions aspnetcore/blazor/host-and-deploy/configure-linker.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: Learn how to control the Intermediate Language (IL) Linker when bui
monikerRange: '= aspnetcore-3.1'
ms.author: wpickett
ms.custom: mvc
ms.date: 11/12/2024
ms.date: 07/29/2025
uid: blazor/host-and-deploy/configure-linker
---
# Configure the Linker for ASP.NET Core Blazor

This article explains how to control the Intermediate Language (IL) Linker when building a Blazor app.
This article explains how to control the Intermediate Language (IL) Linker for client-side scenarios when building a Blazor app.

Blazor WebAssembly performs [Intermediate Language (IL)](/dotnet/standard/glossary#il) linking during a build to trim unnecessary IL from the app's output assemblies. The linker is disabled when building in Debug configuration. Apps must build in Release configuration to enable the linker. We recommend building in Release when deploying your Blazor WebAssembly apps.

Expand All @@ -25,7 +25,7 @@ Linking for Blazor apps can be configured using these MSBuild features:

## Control linking with an MSBuild property

Linking is enabled when an app is built in `Release` configuration. To change this, configure the `BlazorWebAssemblyEnableLinking` MSBuild property in the project file:
By default, linking is enabled when an app is built in `Release` configuration. To disable linking, configure the `BlazorWebAssemblyEnableLinking` MSBuild property in the project file:

```xml
<PropertyGroup>
Expand Down Expand Up @@ -119,4 +119,6 @@ For more information, see [I18N: Pnetlib Internationalization Framework Library

## Additional resources

<xref:blazor/performance/app-download-size#intermediate-language-il-linking>
* <xref:blazor/performance/app-download-size#intermediate-language-il-linking>
* [IL trimmer concepts and related tools (`dotnet/runtime` GitHub repository)](https://github.com/dotnet/runtime/tree/main/docs/tools/illink)
* [Trim self-contained deployments and executables (server-side Blazor apps only](/dotnet/core/deploying/trimming/trim-self-contained)
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The GitHub-hosted Ubuntu (latest) server has a version of the .NET SDK pre-insta
1. Go to the [**Available Images** section of the `actions/runner-images` GitHub repository](https://github.com/actions/runner-images?tab=readme-ov-file#available-images).
1. Locate the `ubuntu-latest` image, which is the first table row.
1. Select the link in the `Included Software` column.
1. Scroll down to the *.NET Tools* section to see the .NET Core SDK installed with the image.
1. Scroll down to the *.NET Tools* section to see the .NET SDK installed with the image.

## Deployment notes

Expand Down
6 changes: 3 additions & 3 deletions aspnetcore/blazor/hosting-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ On the client, the Blazor script establishes the SignalR connection with the ser
The Blazor Server hosting model offers several benefits:

* Download size is significantly smaller than when the Blazor WebAssembly hosting model is used, and the app loads much faster.
* The app takes full advantage of server capabilities, including the use of .NET Core APIs.
* .NET Core on the server is used to run the app, so existing .NET tooling, such as debugging, works as expected.
* The app takes full advantage of server capabilities, including the use of .NET APIs.
* .NET on the server is used to run the app, so existing .NET tooling, such as debugging, works as expected.
* Thin clients are supported. For example, Blazor Server works with browsers that don't support WebAssembly and on resource-constrained devices.
* The app's .NET/C# code base, including the app's component code, isn't served to clients.

Expand Down Expand Up @@ -148,7 +148,7 @@ WebAssembly-rendered Razor components can use [native dependencies](xref:blazor/

:::moniker range="< aspnetcore-6.0"

Blazor WebAssembly includes support for trimming unused code from .NET Core framework libraries. For more information, see <xref:blazor/globalization-localization>.
Blazor WebAssembly includes support for trimming unused code from .NET libraries. For more information, see <xref:blazor/globalization-localization>.

:::moniker-end

Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/blazor/hybrid/security/maui-blazor-web-identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to build a .NET MAUI Blazor Hybrid app with a Blazor Web
monikerRange: '>= aspnetcore-9.0'
ms.author: wpickett
ms.custom: mvc
ms.date: 03/12/2025
ms.date: 07/29/2025
uid: blazor/hybrid/security/maui-blazor-web-identity
---
# .NET MAUI Blazor Hybrid and Web App with ASP.NET Core Identity
Expand Down Expand Up @@ -41,7 +41,7 @@ The sample app is a starter solution that contains a native, cross-platform MAUI
1. Open the solution in Visual Studio (2022 or later) or VS Code with the .NET MAUI extension installed.
1. Set the `MauiBlazorWeb` MAUI project as the startup project. In Visual Studio, right-click the project and select **Set as Startup Project**.
1. Start the `MauiBlazorWeb.Web` project without debugging. In Visual Studio, right-click on the project and select **Debug** > **Start without Debugging**.
1. Inspect the Identity endpoints by navigating to `https://localhost:7157/swagger` in a browser.
1. Inspect the Identity endpoints via [OpenAPI documentation](xref:fundamentals/openapi/overview). You can add a third-party OpenAPI-compliant visual UI/endpoint tester.
1. Navigate to `https://localhost:7157/account/register` to register a user in the Blazor Web App. Immediately after the user is registered, use the **Click here to confirm your account** link in the UI to confirm the user's email address because a real email sender isn't registered for account confirmation.
1. Start (`F5`) the `MauiBlazorWeb` MAUI project. You can set the debug target to either **Windows** or an Android emulator.
1. Notice you can only see the `Home` and `Login` pages.
Expand Down
11 changes: 3 additions & 8 deletions aspnetcore/blazor/security/blazor-web-app-with-entra.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to secure a Blazor Web App with Microsoft Entra ID.
monikerRange: '>= aspnetcore-9.0'
ms.author: wpickett
ms.custom: mvc
ms.date: 06/11/2025
ms.date: 07/29/2025
uid: blazor/security/blazor-web-app-entra
zone_pivot_groups: blazor-web-app-entra-specification
---
Expand All @@ -14,7 +14,6 @@ zone_pivot_groups: blazor-web-app-entra-specification
<!-- UPDATE 10.0 Activate after release and INCLUDE is updated

[!INCLUDE[](~/includes/not-latest-version.md)]

-->

This article describes how to secure a Blazor Web App with [Microsoft identity platform](/entra/identity-platform/) with [Microsoft Identity Web packages](/entra/msal/dotnet/microsoft-identity-web/) for [Microsoft Entra ID](https://www.microsoft.com/security/business/microsoft-entra) using a sample app.
Expand Down Expand Up @@ -77,7 +76,7 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.

The `MinimalApiJwt.http` file can be used for testing the weather data request. Note that the `MinimalApiJwt` project must be running to test the endpoint, and the endpoint is hardcoded into the file. For more information, see <xref:test/http-files>.

The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview) and the [Swagger UI](https://swagger.io/api-hub/) in the Development environment. For more information, see <xref:fundamentals/openapi/using-openapi-documents#use-swagger-ui-for-local-ad-hoc-testing>.
The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).

A secure weather forecast data endpoint is in the project's `Program` file:

Expand Down Expand Up @@ -289,7 +288,7 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.

The `MinimalApiJwt.http` file can be used for testing the weather data request. Note that the `MinimalApiJwt` project must be running to test the endpoint, and the endpoint is hardcoded into the file. For more information, see <xref:test/http-files>.

The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview) and the [Swagger UI](https://swagger.io/api-hub/) in the Development environment. For more information, see <xref:fundamentals/openapi/using-openapi-documents#use-swagger-ui-for-local-ad-hoc-testing>.
The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).

A secure weather forecast data endpoint is in the project's `Program` file:

Expand Down Expand Up @@ -561,14 +560,10 @@ msIdentityOptions.ClientSecret = AzureHelper.GetKeyVaultSecret("{VAULT URI}",

Configuration is used to facilitate supplying dedicated key vaults and secret names based on the app's environmental configuration files. For example, you can supply different configuration values for `appsettings.Development.json` in development, `appsettings.Staging.json` when staging, and `appsettings.Production.json` for the production deployment. For more information, see <xref:blazor/fundamentals/configuration>.

:::moniker range=">= aspnetcore-9.0"

## Only serialize the name and role claims

In the `Program` file, all claims are serialized by setting <xref:Microsoft.AspNetCore.Components.WebAssembly.Server.AuthenticationStateSerializationOptions.SerializeAllClaims%2A> to `true`. If you only want the name and role claims serialized for CSR, remove the option or set it to `false`.

:::moniker-end

## Supply configuration with the JSON configuration provider (app settings)

The [sample solution projects](#sample-solution) configure Microsoft Identity Web and JWT bearer authentication in their `Program` files in order to make configuration settings discoverable using C# autocompletion. Professional apps usually use a *configuration provider* to configure OIDC options, such as the default [JSON configuration provider](xref:fundamentals/configuration/index). The JSON configuration provider loads configuration from app settings files `appsettings.json`/`appsettings.{ENVIRONMENT}.json`, where the `{ENVIRONMENT}` placeholder is the app's [runtime environment](xref:fundamentals/environments). Follow the guidance in this section to use app settings files for configuration.
Expand Down
34 changes: 32 additions & 2 deletions aspnetcore/blazor/security/blazor-web-app-with-oidc.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to secure a Blazor Web App with OpenID Connect (OIDC).
monikerRange: '>= aspnetcore-8.0'
ms.author: wpickett
ms.custom: mvc
ms.date: 04/29/2025
ms.date: 07/29/2025
uid: blazor/security/blazor-web-app-oidc
zone_pivot_groups: blazor-web-app-oidc-specification
---
Expand Down Expand Up @@ -57,7 +57,7 @@ Sample solution features:

* The app securely calls a web API for weather data:

* When rendering the `Weather` component on the server, the component uses the `ServerWeatherForecaster` on the server to obtain weather data from the web API in the `MinimalApiJwt` project using a <xref:System.Net.Http.DelegatingHandler> (`TokenHandler`) that attaches the access token from the <xref:Microsoft.AspNetCore.Http.HttpContext> to the request.
* When rendering the `Weather` component on the server, the component uses the `ServerWeatherForecaster` on the server to obtain weather data from the web API in the `MinimalApiJwt` project using a <xref:System.Net.Http.DelegatingHandler> (`TokenHandler`) that attaches the access token from the <xref:Microsoft.AspNetCore.Http.HttpContext> to the request.
* When the component is rendered on the client, the component uses the `ClientWeatherForecaster` service implementation, which uses a preconfigured <xref:System.Net.Http.HttpClient> (in the client project's `Program` file) to make the web API call from the server project's `ServerWeatherForecaster`.

:::moniker range=">= aspnetcore-9.0"
Expand Down Expand Up @@ -116,8 +116,18 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.

The `MinimalApiJwt.http` file can be used for testing the weather data request. Note that the `MinimalApiJwt` project must be running to test the endpoint, and the endpoint is hardcoded into the file. For more information, see <xref:test/http-files>.

:::moniker range=">= aspnetcore-9.0"

The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).

:::moniker-end

:::moniker range="< aspnetcore-9.0"

The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview) and the [Swagger UI](https://swagger.io/api-hub/) in the Development environment. For more information, see <xref:fundamentals/openapi/using-openapi-documents#use-swagger-ui-for-local-ad-hoc-testing>.

:::moniker-end

The project creates a [Minimal API](xref:fundamentals/minimal-apis) endpoint for weather data:

```csharp
Expand Down Expand Up @@ -453,8 +463,18 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.

The `MinimalApiJwt.http` file can be used for testing the weather data request. Note that the `MinimalApiJwt` project must be running to test the endpoint, and the endpoint is hardcoded into the file. For more information, see <xref:test/http-files>.

:::moniker range=">= aspnetcore-9.0"

The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).

:::moniker-end

:::moniker range="< aspnetcore-9.0"

The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview) and the [Swagger UI](https://swagger.io/api-hub/) in the Development environment. For more information, see <xref:fundamentals/openapi/using-openapi-documents#use-swagger-ui-for-local-ad-hoc-testing>.

:::moniker-end

The project creates a [Minimal API](xref:fundamentals/minimal-apis) endpoint for weather data:

```csharp
Expand Down Expand Up @@ -848,8 +868,18 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.

The `MinimalApiJwt.http` file can be used for testing the weather data request. Note that the `MinimalApiJwt` project must be running to test the endpoint, and the endpoint is hardcoded into the file. For more information, see <xref:test/http-files>.

:::moniker range=">= aspnetcore-9.0"

The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).

:::moniker-end

:::moniker range="< aspnetcore-9.0"

The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview) and the [Swagger UI](https://swagger.io/api-hub/) in the Development environment. For more information, see <xref:fundamentals/openapi/using-openapi-documents#use-swagger-ui-for-local-ad-hoc-testing>.

:::moniker-end

A secure weather forecast data endpoint is in the project's `Program` file:

```csharp
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/blazor/security/includes/troubleshoot-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ One approach to prevent lingering cookies and site data from interfering with te

### App upgrades

A functioning app may fail immediately after upgrading either the .NET Core SDK on the development machine or changing package versions within the app. In some cases, incoherent packages may break an app when performing major upgrades. Most of these issues can be fixed by following these instructions:
A functioning app may fail immediately after upgrading either the .NET SDK on the development machine or changing package versions within the app. In some cases, incoherent packages may break an app when performing major upgrades. Most of these issues can be fixed by following these instructions:

1. Clear the local system's NuGet package caches by executing [`dotnet nuget locals all --clear`](/dotnet/core/tools/dotnet-nuget-locals) from a command shell.
1. Delete the project's `bin` and `obj` folders.
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/blazor/security/includes/troubleshoot-wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ One approach to prevent lingering cookies and site data from interfering with te

### App upgrades

A functioning app may fail immediately after upgrading either the .NET Core SDK on the development machine or changing package versions within the app. In some cases, incoherent packages may break an app when performing major upgrades. Most of these issues can be fixed by following these instructions:
A functioning app may fail immediately after upgrading either the .NET SDK on the development machine or changing package versions within the app. In some cases, incoherent packages may break an app when performing major upgrades. Most of these issues can be fixed by following these instructions:

1. Clear the local system's NuGet package caches by executing [`dotnet nuget locals all --clear`](/dotnet/core/tools/dotnet-nuget-locals) from a command shell.
1. Delete the project's `bin` and `obj` folders.
Expand Down
Loading
Loading