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.

Blazor Preview4 increase buffer size

See original GitHub issue

Using the new Blazor Serverside Preview 4 breaks my upload Component.

Preview 3 I was able to increase the SignalR connection buffer size using

` app.UseRouting(routes =>
        {
            routes.MapRazorPages();
            routes.MapHub<ComponentHub>(
                ComponentHub.DefaultPath,
                o =>
                {
                    o.ApplicationMaxBufferSize = 102400000; // larger size
                    o.TransportMaxBufferSize = 102400000; // larger size
                })
                .AddComponent<App>("app");
        });`

In preview 4 it has switched to endpoint routing

app.UseEndpoints(endpoints =>
           {
               endpoints.MapBlazorHub();
               endpoints.MapFallbackToPage("/_Host");
           });

How would I configure MapBlazorHub(); Related Issue #7884

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:21 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
julienGrdcommented, Jul 29, 2019

[EDIT] : I find the solution for preview 7 in another post, i put the solution bellow

pServices.AddServerSideBlazor()
            .AddHubOptions(o =>
             {
                 o.MaximumReceiveMessageSize = 102400000;
             });

Hi guys, i’m currently under preview 7 (server-side version) and i meet the same problem. i try to send a base64 string wich represent an image from js to one of my components (with JSInvokable). I try tu use code you suggest on this post but I have reference problem (maybe this workaround is outdated ?)

endpoints.MapBlazorHub<ComponentHub>(
                    ComponentHub.DefaultPath,
                    o =>
                    {
                        o.ApplicationMaxBufferSize = 102400000; // larger size
                        o.TransportMaxBufferSize = 102400000; // larger size
                    });

I’m unable to resolve ComponentHub. When i check what’s expected, it’s seem to be a IComponent (so my root Component ?)

I don’t understand what can i done now to bypass the problem

thanks for your help !

2reactions
tmayonezcommented, Apr 24, 2019

I’ve got the same problem. I’ve investigated that it’s not because MaximumReceiveMessageSize. It is impossible to invoke .NET method from javascript if parameters passed to method are to big. I guess, the limit of parameters serialized to JSON during invokeMethodAsync is 4KB. Worked fine before preview 4.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blazor Preview4 increase buffer size · Issue #9570
Using the new Blazor Serverside Preview 4 breaks my upload Component. Preview 3 I was able to increase the SignalR connection buffer size...
Read more >
Increase the connection buffer size in Blazor PDF Viewer
Learn here all about how to increase the connection buffer size in Syncfusion Blazor PDF Viewer component and more.
Read more >
Increase Speed for Streaming Large(1-10 gb) files .Net Core
What I tried: default buffer size for Stream::CopyToAsync is 81920 bytes, I used the same value first, then I tried to increase buffer...
Read more >
ASP.NET Core Blazor file uploads
OpenReadStream enforces a maximum size in bytes of its Stream. Reading one file or multiple files larger than 500 KB results in an...
Read more >
ASP.NET Core updates in .NET 6 Preview 4
The size of an AOT compiled Blazor WebAssembly app is generally larger than the if the app was left as .NET IL. In...
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