Skip to content

Commit aebcf12

Browse files
authored
Blazor 9.0 updates (#34277)
1 parent 05a56d7 commit aebcf12

File tree

7 files changed

+15
-44
lines changed

7 files changed

+15
-44
lines changed

aspnetcore/blazor/file-uploads.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,15 @@ public class UploadResult
259259

260260
A security best practice for production apps is to avoid sending error messages to clients that might reveal sensitive information about an app, server, or network. Providing detailed error messages can aid a malicious user in devising attacks on an app, server, or network. The example code in this section only sends back an error code number (`int`) for display by the component client-side if a server-side error occurs. If a user requires assistance with a file upload, they provide the error code to support personnel for support ticket resolution without ever knowing the exact cause of the error.
261261

262-
<!-- UPDATE 9.0 HOLD moniker range="< aspnetcore-9.0" -->
262+
<!-- UPDATE 10.0 HOLD moniker range="< aspnetcore-9.0" Tracking PU bug: https://github.com/dotnet/aspnetcore/issues/47301 -->
263263

264264
The following `LazyBrowserFileStream` class defines a custom stream type that lazily calls <xref:Microsoft.AspNetCore.Components.Forms.IBrowserFile.OpenReadStream%2A> just before the first bytes of the stream are requested. The stream isn't transmitted from the browser to the server until reading the stream begins in .NET.
265265

266266
`LazyBrowserFileStream.cs`:
267267

268-
<!-- UPDATE 9.0 HOLD moniker-end -->
268+
<!-- UPDATE 10.0 HOLD moniker-end -->
269269

270-
<!-- UPDATE 9.0 HOLD for next line: < aspnetcore-9.0 -->
270+
<!-- UPDATE 10.0 HOLD for next line: < aspnetcore-9.0 -->
271271

272272
:::moniker range=">= aspnetcore-8.0"
273273

@@ -332,7 +332,7 @@ The following `FileUpload2` component:
332332

333333
:::moniker-end
334334

335-
<!-- UPDATE 9.0 HOLD for the next line: < aspnetcore-9.0 -->
335+
<!-- UPDATE 10.0 HOLD for the next line: < aspnetcore-9.0 -->
336336

337337
:::moniker range=">= aspnetcore-8.0"
338338

@@ -909,10 +909,6 @@ For more information on SignalR configuration and how to set <xref:Microsoft.Asp
909909

910910
## Maximum parallel invocations per client hub setting
911911

912-
<!-- UPDATE 9.0 Check on a fix for this per
913-
https://github.com/dotnet/aspnetcore/issues/53951
914-
and version if fixed. -->
915-
916912
Blazor relies on <xref:Microsoft.AspNetCore.SignalR.HubOptions.MaximumParallelInvocationsPerClient%2A> set to 1, which is the default value.
917913

918914
Increasing the value leads to a high probability that `CopyTo` operations throw `System.InvalidOperationException: 'Reading is not allowed after reader was completed.'`. For more information, see [MaximumParallelInvocationsPerClient > 1 breaks file upload in Blazor Server mode (`dotnet/aspnetcore` #53951)](https://github.com/dotnet/aspnetcore/issues/53951).
@@ -925,13 +921,11 @@ The line that calls <xref:Microsoft.AspNetCore.Components.Forms.IBrowserFile.Ope
925921
926922
Possible causes:
927923

928-
<!-- UPDATE 9.0 HOLD: in versions of ASP.NET Core earlier than 9.0 -->
929-
930924
* Using the [Autofac Inversion of Control (IoC) container](https://autofac.org/) instead of the built-in ASP.NET Core dependency injection container. To resolve the issue, set <xref:Microsoft.AspNetCore.SignalR.HubOptions.DisableImplicitFromServicesParameters%2A> to `true` in the [server-side circuit handler hub options](xref:blazor/fundamentals/signalr#server-side-circuit-handler-options). For more information, see [FileUpload: Did not receive any data in the allotted time (`dotnet/aspnetcore` #38842)](https://github.com/dotnet/aspnetcore/issues/38842#issuecomment-1342540950).
931925

932926
* Not reading the stream to completion. This isn't a framework issue. Trap the exception and investigate it further in your local environment/network.
933927

934-
<!-- UPDATE 9.0 HOLD in versions of ASP.NET Core earlier than 9.0
928+
<!-- UPDATE 10.0 HOLD in versions of ASP.NET Core earlier than 9.0
935929
adopt ***either*** of the following approaches: * Upgrade the app to ASP.NET Core 9.0 or later.
936930
with the article version selector set to "ASP.NET Core in .NET 8" or earlier -->
937931

aspnetcore/blazor/host-and-deploy/server.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,7 @@ The service isn't required for Blazor apps hosted in Azure App Service or Azure
9595

9696
:::moniker range=">= aspnetcore-8.0"
9797

98-
<!-- UPDATE 9.0 Update section to only cross-link stateful
99-
reconnect guidance after the feature is
100-
supported with Azure SignalR Service. -->
101-
102-
> [!NOTE]
103-
> [Stateful reconnect](xref:signalr/configuration#configure-stateful-reconnect) (<xref:Microsoft.AspNetCore.SignalR.Client.HubConnectionBuilderHttpExtensions.WithStatefulReconnect%2A>) was released with .NET 8 but isn't currently supported for the Azure SignalR Service. For more information, see [Stateful Reconnect Support? (`Azure/azure-signalr` #1878)](https://github.com/Azure/azure-signalr/issues/1878).
98+
The Azure SignalR Service with SDK [v1.26.1](https://github.com/Azure/azure-signalr/releases/tag/v1.26.1) or later supports [SignalR stateful reconnect](xref:signalr/configuration#configure-stateful-reconnect) (<xref:Microsoft.AspNetCore.SignalR.Client.HubConnectionBuilderHttpExtensions.WithStatefulReconnect%2A>).
10499

105100
:::moniker-end
106101

aspnetcore/blazor/hybrid/class-libraries.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,20 @@ For more information, see the following articles:
4848

4949
:::moniker-end
5050

51-
<!-- UPDATE 9.0 Ask Beth on a replacement for this
52-
5351
## Sample app
5452

55-
For an example of the scenarios described in this article, see the .NET Podcasts sample app:
53+
For an example of the scenarios described in this article, see the [eShop Reference Application (AdventureWorks) (`dotnet/eShop` GitHub repository)](https://github.com/dotnet/eShop). The .NET MAUI Blazor Hybrid app is in the `src/HybridApp` folder.
5654

57-
* [GitHub repository (`microsoft/dotnet-podcasts`)](https://github.com/microsoft/dotnet-podcasts)
58-
* [Running sample app (Azure Container Apps Service)](https://dotnetpodcasts.azurewebsites.net/)
55+
For a version of the sample app tailored for Azure hosting, see the [`Azure-Samples/eShopOnAzure` GitHub repository](https://github.com/Azure-Samples/eShopOnAzure).
5956

60-
The .NET Podcasts app showcases the following technologies:
57+
The sample app showcases the following technologies:
6158

6259
* [.NET](https://dotnet.microsoft.com/download/dotnet)
6360
* [ASP.NET Core](https://dotnet.microsoft.com/apps/aspnet)
6461
* [Blazor](https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor)
6562
* [.NET MAUI](https://dotnet.microsoft.com/apps/maui)
66-
* [Azure Container Apps](https://azure.microsoft.com/services/container-apps/)
67-
* [Orleans](/dotnet/orleans/overview)
68-
69-
-->
63+
* [.NET Aspire](/dotnet/aspire/get-started/aspire-overview)
64+
* [Docker](https://docs.docker.com/get-started/docker-overview/)
7065

7166
## Share web UI Razor components, code, and static assets
7267

aspnetcore/blazor/hybrid/reuse-razor-components.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,8 @@ For an example, see <xref:blazor/hybrid/tutorials/maui-blazor-web-app#using-inte
7575

7676
:::moniker-end
7777

78-
<!-- UPDATE 9.0 Ask Beth on a replacement for this
79-
8078
## Additional resources
8179

82-
* .NET MAUI Blazor podcast sample app
83-
* [Source code (`microsoft/dotnet-podcasts` GitHub repository)](https://github.com/microsoft/dotnet-podcasts)
84-
* [Live app](https://dotnetpodcasts.azurewebsites.net/)
85-
86-
-->
80+
* eShop Reference Application (AdventureWorks): The .NET MAUI Blazor Hybrid app is in the `src/HybridApp` folder.
81+
* For Azure hosting: [`Azure-Samples/eShopOnAzure` GitHub repository](https://github.com/Azure-Samples/eShopOnAzure)
82+
* For general non-Azure hosting: [`dotnet/eShop` GitHub repository](https://github.com/dotnet/eShop).

aspnetcore/blazor/security/blazor-web-app-with-oidc.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -731,11 +731,6 @@ At this point, Razor components can adopt [role-based and policy-based authoriza
731731

732732
Use the guidance in this section to implement application roles, ME-ID security groups, and ME-ID built-in administrator roles for apps using [Microsoft Entra ID (ME-ID)](https://www.microsoft.com/security/business/microsoft-entra).
733733

734-
<!-- UPDATE 9.0 If we end up with a BWA + MS Identity Web article
735-
and sample, this section will be removed in favor
736-
of coverage of using Graph for groups/roles in the
737-
new article. -->
738-
739734
The approach described in this section configures ME-ID to send groups and roles in the authentication cookie header. When users are only a member of a few security groups and roles, the following approach should work for most hosting platforms without running into a problem where headers are too long, for example with IIS hosting that has a default header length limit of 16 KB (`MaxRequestBytes`). If header length is a problem due to high group or role membership, we recommend not following the guidance in this section in favor of implementing [Microsoft Graph](/graph/sdks/sdks-overview) to obtain a user's groups and roles from ME-ID separately, an approach that doesn't inflate the size of the authentication cookie. For more information, see [Bad Request - Request Too Long - IIS Server (`dotnet/aspnetcore` #57545)](https://github.com/dotnet/aspnetcore/issues/57545).
740735

741736
Configure the role claim type (<xref:Microsoft.IdentityModel.Tokens.TokenValidationParameters.RoleClaimType?displayProperty=nameWithType>) in <xref:Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectOptions> of `Program.cs`. Set the value to `roles`:

aspnetcore/blazor/security/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,6 @@ For a description on how global interactive render modes are applied to non-Iden
283283

284284
For more information on persisting prerendered state, see <xref:blazor/components/prerender#persist-prerendered-state>.
285285

286-
<!-- UPDATE 9.0 Remove blog post cross-link -->
287-
288-
For more information on the Blazor Identity UI and guidance on integrating external logins through social websites, see [What's new with identity in .NET 8](https://devblogs.microsoft.com/dotnet/whats-new-with-identity-in-dotnet-8/#the-blazor-identity-ui).
289-
290286
[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]
291287

292288
### Manage authentication state in Blazor Web Apps

aspnetcore/blazor/tutorials/movie-database-app/part-2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ When you select the **:::no-loc text="Create":::** button, the movie data is pos
417417

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

420-
<!-- UPDATE 9.0 Revert when debugger is updated -->
420+
<!-- UPDATE 10.0 Revert when https://github.com/dotnet/aspnetcore/issues/53996 is addressed -->
421421

422422
:::zone pivot="vs"
423423

0 commit comments

Comments
 (0)