If I debug my code for more than 30 seconds, the web page shows
"Attempting to reconnect to the server: # of 8"
and dev console message is
"Error: Connection disconnected with error 'Error: Server timeout elapsed without receiving a message from the server".
Is there any setting that can disable timeout or at least make it way longer than it is now?
In case you use long polling you need to add also this configuration option:
app.UseEndpoints(endpoints =>
// other settings go here
endpoints.MapBlazorHub(options => {
options.WebSockets.CloseTimeout = new TimeSpan(1, 1, 1);
options.LongPolling.PollTimeout = new TimeSpan(1, 0, 0);
})
);
Modify the _Host.cshtml file (or _Layout.cshtml in ASP.NET 6):
<environment include="Development">
<script src="_framework/blazor.server.js" autostart="false"></script>
<script>
Blazor.start({
configureSignalR: function (builder)
{
let c = builder.build();
c.serverTimeoutInMilliseconds = 9999999;
builder.build = () => c;
}});
</script>
</environment>
<environment exclude="Development">
<script src="_framework/blazor.server.js"></script>
</environment>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With