You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/doc-issue.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Check the .NET target framework(s) being used, and include the version number(s)
36
36
*[ ] .NET Framework
37
37
*[ ] .NET Standard
38
38
39
-
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.
39
+
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.
40
40
41
41
<details>
42
42
<summary><strong>dotnet --info output</strong> or <strong>About VS info</strong></summary>
Copy file name to clipboardExpand all lines: aspnetcore/blazor/call-web-api.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to call a web API from Blazor apps.
5
5
monikerRange: '>= aspnetcore-3.1'
6
6
ms.author: wpickett
7
7
ms.custom: mvc
8
-
ms.date: 06/11/2025
8
+
ms.date: 07/29/2025
9
9
uid: blazor/call-web-api
10
10
---
11
11
# Call a web API from ASP.NET Core Blazor
@@ -61,7 +61,7 @@ In the app's `Program` file, call:
61
61
62
62
*<xref:Microsoft.Identity.Web.MicrosoftIdentityWebApiAuthenticationBuilder.EnableTokenAcquisitionToCallDownstreamApi%2A>: Enables token acquisition to call web APIs.
63
63
*`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).
64
-
*<xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.DistributedTokenCacheAdapterExtension.AddDistributedTokenCaches%2A>: Adds the .NET Core distributed token caches to the service collection.
64
+
*<xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.DistributedTokenCacheAdapterExtension.AddDistributedTokenCaches%2A>: Adds the .NET distributed token caches to the service collection.
65
65
*<xref:Microsoft.Extensions.DependencyInjection.MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache%2A>: Adds a default implementation of <xref:Microsoft.Extensions.Caching.Distributed.IDistributedCache> that stores cache items in memory.
66
66
* Configure the distributed token cache options (<xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.MsalDistributedTokenCacheAdapterOptions>):
67
67
* 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.***
Copy file name to clipboardExpand all lines: aspnetcore/blazor/host-and-deploy/configure-linker.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,12 @@ description: Learn how to control the Intermediate Language (IL) Linker when bui
5
5
monikerRange: '= aspnetcore-3.1'
6
6
ms.author: wpickett
7
7
ms.custom: mvc
8
-
ms.date: 11/12/2024
8
+
ms.date: 07/29/2025
9
9
uid: blazor/host-and-deploy/configure-linker
10
10
---
11
11
# Configure the Linker for ASP.NET Core Blazor
12
12
13
-
This article explains how to control the Intermediate Language (IL) Linker when building a Blazor app.
13
+
This article explains how to control the Intermediate Language (IL) Linker for client-side scenarios when building a Blazor app.
14
14
15
15
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.
16
16
@@ -25,7 +25,7 @@ Linking for Blazor apps can be configured using these MSBuild features:
25
25
26
26
## Control linking with an MSBuild property
27
27
28
-
Linking is enabled when an app is built in `Release` configuration. To change this, configure the `BlazorWebAssemblyEnableLinking` MSBuild property in the project file:
28
+
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:
29
29
30
30
```xml
31
31
<PropertyGroup>
@@ -119,4 +119,6 @@ For more information, see [I18N: Pnetlib Internationalization Framework Library
Copy file name to clipboardExpand all lines: aspnetcore/blazor/host-and-deploy/webassembly/github-pages.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ The GitHub-hosted Ubuntu (latest) server has a version of the .NET SDK pre-insta
63
63
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).
64
64
1. Locate the `ubuntu-latest` image, which is the first table row.
65
65
1. Select the link in the `Included Software` column.
66
-
1. Scroll down to the *.NET Tools* section to see the .NET Core SDK installed with the image.
66
+
1. Scroll down to the *.NET Tools* section to see the .NET SDK installed with the image.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/hosting-models.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,8 +65,8 @@ On the client, the Blazor script establishes the SignalR connection with the ser
65
65
The Blazor Server hosting model offers several benefits:
66
66
67
67
* Download size is significantly smaller than when the Blazor WebAssembly hosting model is used, and the app loads much faster.
68
-
* The app takes full advantage of server capabilities, including the use of .NET Core APIs.
69
-
* .NET Core on the server is used to run the app, so existing .NET tooling, such as debugging, works as expected.
68
+
* The app takes full advantage of server capabilities, including the use of .NET APIs.
69
+
* .NET on the server is used to run the app, so existing .NET tooling, such as debugging, works as expected.
70
70
* Thin clients are supported. For example, Blazor Server works with browsers that don't support WebAssembly and on resource-constrained devices.
71
71
* The app's .NET/C# code base, including the app's component code, isn't served to clients.
72
72
@@ -148,7 +148,7 @@ WebAssembly-rendered Razor components can use [native dependencies](xref:blazor/
148
148
149
149
:::moniker range="< aspnetcore-6.0"
150
150
151
-
Blazor WebAssembly includes support for trimming unused code from .NET Core framework libraries. For more information, see <xref:blazor/globalization-localization>.
151
+
Blazor WebAssembly includes support for trimming unused code from .NET libraries. For more information, see <xref:blazor/globalization-localization>.
# .NET MAUI Blazor Hybrid and Web App with ASP.NET Core Identity
@@ -41,7 +41,7 @@ The sample app is a starter solution that contains a native, cross-platform MAUI
41
41
1. Open the solution in Visual Studio (2022 or later) or VS Code with the .NET MAUI extension installed.
42
42
1. Set the `MauiBlazorWeb` MAUI project as the startup project. In Visual Studio, right-click the project and select **Set as Startup Project**.
43
43
1. Start the `MauiBlazorWeb.Web` project without debugging. In Visual Studio, right-click on the project and select **Debug** > **Start without Debugging**.
44
-
1. Inspect the Identity endpoints by navigating to `https://localhost:7157/swagger` in a browser.
44
+
1. Inspect the Identity endpoints via [OpenAPI documentation](xref:fundamentals/openapi/overview). You can add a third-party OpenAPI-compliant visual UI/endpoint tester.
45
45
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.
46
46
1. Start (`F5`) the `MauiBlazorWeb` MAUI project. You can set the debug target to either **Windows** or an Android emulator.
47
47
1. Notice you can only see the `Home` and `Login` pages.
<!-- UPDATE 10.0 Activate after release and INCLUDE is updated
15
15
16
16
[!INCLUDE[](~/includes/not-latest-version.md)]
17
-
18
17
-->
19
18
20
19
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.
@@ -77,7 +76,7 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.
77
76
78
77
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>.
79
78
80
-
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>.
79
+
The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).
81
80
82
81
A secure weather forecast data endpoint is in the project's `Program` file:
83
82
@@ -289,7 +288,7 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.
289
288
290
289
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>.
291
290
292
-
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>.
291
+
The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).
293
292
294
293
A secure weather forecast data endpoint is in the project's `Program` file:
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>.
563
562
564
-
:::moniker range=">= aspnetcore-9.0"
565
-
566
563
## Only serialize the name and role claims
567
564
568
565
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`.
569
566
570
-
:::moniker-end
571
-
572
567
## Supply configuration with the JSON configuration provider (app settings)
573
568
574
569
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.
* The app securely calls a web API for weather data:
59
59
60
-
* 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.
60
+
* 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.
61
61
* 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`.
62
62
63
63
:::moniker range=">= aspnetcore-9.0"
@@ -116,8 +116,18 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.
116
116
117
117
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>.
118
118
119
+
:::moniker range=">= aspnetcore-9.0"
120
+
121
+
The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).
122
+
123
+
:::moniker-end
124
+
125
+
:::moniker range="< aspnetcore-9.0"
126
+
119
127
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>.
120
128
129
+
:::moniker-end
130
+
121
131
The project creates a [Minimal API](xref:fundamentals/minimal-apis) endpoint for weather data:
122
132
123
133
```csharp
@@ -453,8 +463,18 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.
453
463
454
464
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>.
455
465
466
+
:::moniker range=">= aspnetcore-9.0"
467
+
468
+
The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).
469
+
470
+
:::moniker-end
471
+
472
+
:::moniker range="< aspnetcore-9.0"
473
+
456
474
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>.
457
475
476
+
:::moniker-end
477
+
458
478
The project creates a [Minimal API](xref:fundamentals/minimal-apis) endpoint for weather data:
459
479
460
480
```csharp
@@ -848,8 +868,18 @@ The `MinimalApiJwt` project is a backend web API for multiple frontend projects.
848
868
849
869
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>.
850
870
871
+
:::moniker range=">= aspnetcore-9.0"
872
+
873
+
The project includes packages and configuration to produce [OpenAPI documents](xref:fundamentals/openapi/overview).
874
+
875
+
:::moniker-end
876
+
877
+
:::moniker range="< aspnetcore-9.0"
878
+
851
879
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>.
852
880
881
+
:::moniker-end
882
+
853
883
A secure weather forecast data endpoint is in the project's `Program` file:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/security/includes/troubleshoot-server.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ One approach to prevent lingering cookies and site data from interfering with te
93
93
94
94
### App upgrades
95
95
96
-
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:
96
+
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:
97
97
98
98
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.
0 commit comments