Hi guys,
I’m trying to get SignalR working in a Servicestack Blazor application with no luck. I originally wanted to use ServiceStack Server Events - but was blocked by technical difficulties (see here). Rather than wrestle with JavaScript interop, I took a look at SignalR - and it looks like a good solution (failing over from Websockets to Server Events to Longpolling, works in blazor webassembly, will allow me to avoid the complexity of invoking C# code via JavaScript).
If I follow the standard SignalR Blazor tutorial from Microsoft (here) I am able to successfully communicate with the blazor client application. However, if I follow a similar process when using servicestack’s blazor-wasm template - I get the following errors:
I am at a loss to try and troubleshoot this…and I was hoping that you had some ideas on how to tackle this. Could it be SS Routing that is causing the issue? Could it be Authentication?
My Program.cs File looks like this (I originally had the SignalR configuration in a modular startup file, and tried to follow the MS tutorial more closely, thinking it might be an order-of-operations issue):
The code in my index.razor which initializes the hub connection looks like this: