Skip to content

Commit 3f83b89

Browse files
committed
chore(common) update kb
1 parent 3579225 commit 3f83b89

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

knowledge-base/common-increase-signalr-max-message-size.md

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Blazor Server apps use a **SignalR WebSocket** to communicate between the client
4747

4848
Increase the `MaximumReceiveMessageSize` via `HubOptions`. The syntax and code placement can vary, depending on the .NET version or when the application was created. Here are a few possible alternatives.
4949

50-
>caption Program.cs (.NET 6+)
50+
>caption Use `Configure<HubOptions>` in Program.cs
5151
5252
<div class="skip-repl"></div>
5353

@@ -64,7 +64,7 @@ builder.Services.Configure<HubOptions>(options =>
6464
});
6565
````
6666

67-
>caption Use AddHubOptions in .NET 6+
67+
>caption Use `AddHubOptions` in Program.cs
6868
6969
<div class="skip-repl"></div>
7070

@@ -74,34 +74,6 @@ builder.Services.AddServerSideBlazor().AddHubOptions(options => {
7474
});
7575
````
7676

77-
>caption Startup.cs (.NET 3.1)
78-
79-
<div class="skip-repl"></div>
80-
81-
````CS
82-
using Microsoft.AspNetCore.SignalR;
83-
84-
public void ConfigureServices(IServiceCollection services)
85-
{
86-
services.AddServerSideBlazor();
87-
88-
services.Configure<HubOptions>(options =>
89-
{
90-
options.MaximumReceiveMessageSize = 1024 * 1024; // 1MB or use null
91-
});
92-
}
93-
````
94-
95-
>caption Use AddHubOptions in .NET 3.1
96-
97-
<div class="skip-repl"></div>
98-
99-
````CS
100-
services.AddServerSideBlazor().AddHubOptions(options => {
101-
options.MaximumReceiveMessageSize = null; // no limit or use a number
102-
});
103-
````
104-
10577
Also see these Microsoft articles:
10678

10779
* [ASP.NET Core SignalR configuration](https://learn.microsoft.com/en-us/aspnet/core/signalr/configuration)

0 commit comments

Comments
 (0)