Get WebSocket Connection Problem By Host Blazor With .Net 9

Programming, error messages and sample code > ASP.NET
We fully support .NET 9, the most productive, modern, secure, intelligent, and performant release of .NET yet.
Blazor is better than ever in .NET 9 to empower you to build beautiful modern web & hybrid apps. Blazor apps using interactive server rendering (Blazor Server) benefit from a new reconnection experience that has a friendlier UI, reconnects to the server faster, and automatically handles reloading the page if the user’s connection has been lost.
 
By default, Interactive Server components enable compression for WebSocket connections. However, you might see websocket connection problem with .Net 9.0.0 if you host app in IIS OutOfProcess mode.
 
Error: WebSocket closed with status code: 1006 (no reason given).
 
Solutions:
 
1. change to use InProcess mode with dedicated pool.
2. or disable compression, use the DisableWebSocketCompression option:
app.MapRazorComponents<App>()
   .AddInteractiveServerRenderMode(c => c.DisableWebSocketCompression = true);
 
Note: The new release for .Net 9 will fix such issue.