question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SignalR MaximumReceiveMessageSize

See original GitHub issue

My previous code was:

app.UseSignalR((options) =>{
  options.MapHub<Pages.Hubs.ClientsHub>("/hubs/clientshub", configureOptions => {
      configureOptions.TransportMaxBufferSize = 999999;
      configureOptions.ApplicationMaxBufferSize = 999999;
  });
});

Which worked fine with long buffers.

I now upgraded to preview 8 and changed my code to:

app.UseEndpoints((options) => {
  options.MapHub<ClientsHub>("/hubs/clientshub", configureOptions => {
    configureOptions.TransportMaxBufferSize = 999999;
    configureOptions.ApplicationMaxBufferSize = 999999;
  });
});

but SignalR no longer handles big buffers, I get:

System.IO.InvalidDataException: The maximum message size of 32768B was exceeded. The message size can be configured in AddHubOptions.
   at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.DispatchMessagesAsync(HubConnectionContext connection)
   at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.RunHubAsync(HubConnectionContext connection)

I looked at many threads and found recommendations to use MaximumReceiveMessageSize

However if I try:

app.UseEndpoints((options) =>{
  options.MapHub<ClientsHub>("/hubs/clientshub", configureOptions => {
    configureOptions.MaximumReceiveMessageSize = 102400000;
  });
});

I get :

Error CS1061 ‘HttpConnectionDispatcherOptions’ does not contain a definition for ‘MaximumReceiveMessageSize’ and no accessible extension method ‘MaximumReceiveMessageSize’ accepting a first argument of type ‘HttpConnectionDispatcherOptions’ could be found

There seems to be very little documentation for this - What is the current (preview8) correct way to increase the buffer size for SignalR ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kofifuscommented, Aug 27, 2019

Thanks! please add this to the documentation (SignalR is wonderful, thanks for the work…)

1reaction
davidfowlcommented, Aug 27, 2019

@BrennanConroy lets add this to the migration guide.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SignalR MaximumReceiveMessageSize · Issue #13466
System.IO.InvalidDataException: The maximum message size of 32768B was exceeded. The message size can be configured in AddHubOptions. at ...
Read more >
HubOptions.MaximumReceiveMessageSize Property
Gets or sets the maximum message size of a single incoming hub message. The default is 32KB.
Read more >
How to Increase the Blazor SignalR Maximum Message Size
The SignalR WebSocket has a default maximum message size of 32 KB. A large Editor Value , FileSelect file size, or a PDFViewer...
Read more >
Max limit of message in SignalR - asp.net
Max limit of message in SignalR ... I am trying to send notifications through SignalR. It works perfectly. But what is the maximum...
Read more >
ASP.NET Core SignalR configuration
Learn how to configure ASP.NET Core SignalR apps. ... MaximumReceiveMessageSize, 32 KB, Maximum size of a single incoming hub message.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found