Dotnettency
Dotnettency copied to clipboard
IHostApplicationLifetime needs to be singleton not singleton per tenant.
Seen an issue with tryign to register signal-r per tenant, in that it relies on IHostApplicationLifetime
(provided by the host) to be signalled, in order to start it's background connection managment loop which does things like issue "Keep-alive" pings for connected clients.
The issue is that each tenant is currently getting their own instance of IHostApplicationLifetime
because its registered by type, not by by isntance, so the child container creates its own instance per tenant.
Should perhaps add logic to register the application (existing) instance into each child container rather than add a type registration per tenant.
https://github.com/dotnet/aspnetcore/discussions/26056