'SignalR Connection Closed after the login to asp.net core IIS website
I create a new asp net core website on IIS and worked properly, but after publish the load balancer a new issue appears which is after login to the system, the SignalR connection closed immediately and logout from website due to session timeout. Noting that no clear error appears. Any advice please.
Solution 1:[1]
In load balanced environments SignalR needs to be back-planed, this puts what would otherwise have been stored in your webservers memory into a database. Without back-planing when a SignalR reply comes in via the load balancer and does not end up at the server which originally asked for the reply from the servers POV the reply isn't in response to anything since it has nothing in memory.
Back-planing is really easy. High level overview here: https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-in-signalr
Database specific instructions...
Redis: https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-redis
SQL Server: https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-sql-server
Solution 2:[2]
It is recommended to enable SignalR tracing on the server to view diagnostic information about events in SignalR applications.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | JustAnotherDev |
| Solution 2 | JennyDai |
