Search code examples
c#asp.net-coresignalrblazorwebassembly

How to send data with the size more than Signalr message size limit in Blazor?


We know that Blazor uses SignalR for communication between client and server and also there is a message size limitation in SignalR(which is currently 32k). How it is possible to send more than 32k data from server to client or vise versa?


Solution

  • According to the Microsoft Docs,

    You can set MaximumReceiveMessageSize:

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddSignalR(hubOptions =>
        {
            hubOptions.MaximumReceiveMessageSize = 10 * 1024 * 1024; // 10MB
        });
    }