From bd8cb34854855ee1335bee7ee7ac35583db6f699 Mon Sep 17 00:00:00 2001
From: Luke Latham <1622880+guardrex@users.noreply.github.com>
Date: Tue, 10 Jun 2025 17:40:57 -0400
Subject: [PATCH 1/2] Remove breaking change remarks (#35606)
---
.../tutorials/movie-database-app/part-2.md | 32 -------------------
1 file changed, 32 deletions(-)
diff --git a/aspnetcore/blazor/tutorials/movie-database-app/part-2.md b/aspnetcore/blazor/tutorials/movie-database-app/part-2.md
index 3d385caca8ec..fd54a3234242 100644
--- a/aspnetcore/blazor/tutorials/movie-database-app/part-2.md
+++ b/aspnetcore/blazor/tutorials/movie-database-app/part-2.md
@@ -134,21 +134,6 @@ dotnet add package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
> [!IMPORTANT]
> After the first eight commands execute, make sure that you press Enter on the keyboard to execute the last command.
-:::moniker range=">= aspnetcore-9.0 < aspnetcore-10.0"
-
-
-
-> [!IMPORTANT]
-> A breaking change in EF Core tooling for .NET 9.0.200 SDK prevented scaffolding from executing with the following exception:
->
-> > :::no-loc text="Could not load file or assembly 'Microsoft.EntityFrameworkCore.Design, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.":::
->
-> To resolve the error, upgrade to a .NET 9.0.300 or later SDK.
->
-> For more information, see [Breaking changes in EF Core 9 (EF9)](/ef/core/what-is-new/ef-core-9.0/breaking-changes#microsoftentityframeworkcoredesign-not-found-when-using-ef-tools).
-
-:::moniker-end
-
> [!NOTE]
> The preceding commands are .NET CLI commands, and .NET CLI commands are executed when entered at a [PowerShell](/powershell/) prompt, which is the default command shell of the VS Code **Terminal**.
@@ -191,23 +176,6 @@ dotnet add package Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdap
dotnet add package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
```
-:::moniker range=">= aspnetcore-9.0 < aspnetcore-10.0"
-
-
-
-> [!IMPORTANT]
-> A breaking change in EF Core tooling for .NET 9.0.200 SDK prevented scaffolding from executing with the following exception:
->
-> > :::no-loc text="Could not load file or assembly 'Microsoft.EntityFrameworkCore.Design, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.":::
->
-> To resolve the error, upgrade to a .NET 9.0.300 or later SDK.
->
-> For more information, see [Breaking changes in EF Core 9 (EF9)](/ef/core/what-is-new/ef-core-9.0/breaking-changes#microsoftentityframeworkcoredesign-not-found-when-using-ef-tools).
-
-:::moniker-end
-
-:::moniker-end
-
Save the project file.
The preceding commands add:
From 0cf8e939bdd90fe9577b4416f019b92026e3e977 Mon Sep 17 00:00:00 2001
From: Luke Latham <1622880+guardrex@users.noreply.github.com>
Date: Tue, 10 Jun 2025 21:19:42 -0400
Subject: [PATCH 2/2] Fix token handler example (#35609)
---
.../security/blazor-web-app-with-oidc.md | 20 +++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/aspnetcore/blazor/security/blazor-web-app-with-oidc.md b/aspnetcore/blazor/security/blazor-web-app-with-oidc.md
index d33e20ab2065..2a719c558366 100644
--- a/aspnetcore/blazor/security/blazor-web-app-with-oidc.md
+++ b/aspnetcore/blazor/security/blazor-web-app-with-oidc.md
@@ -193,9 +193,13 @@ public class TokenHandler(IHttpContextAccessor httpContextAccessor) :
protected override async Task SendAsync(
HttpRequestMessage request, CancellationToken cancellationToken)
{
- var accessToken = httpContextAccessor.HttpContext?
- .GetTokenAsync("access_token").Result ??
- throw new Exception("No access token");
+ if (httpContextAccessor.HttpContext is null)
+ {
+ throw new Exception("HttpContext not available");
+ }
+
+ var accessToken = await httpContextAccessor.HttpContext
+ .GetTokenAsync("access_token");
request.Headers.Authorization =
new AuthenticationHeaderValue("Bearer", accessToken);
@@ -526,9 +530,13 @@ public class TokenHandler(IHttpContextAccessor httpContextAccessor) :
protected override async Task SendAsync(
HttpRequestMessage request, CancellationToken cancellationToken)
{
- var accessToken = httpContextAccessor.HttpContext?
- .GetTokenAsync("access_token").Result ??
- throw new Exception("No access token");
+ if (httpContextAccessor.HttpContext is null)
+ {
+ throw new Exception("HttpContext not available");
+ }
+
+ var accessToken = await httpContextAccessor.HttpContext
+ .GetTokenAsync("access_token");
request.Headers.Authorization =
new AuthenticationHeaderValue("Bearer", accessToken);