'How to Run SignalR service as a Server in Xamarin
I have a requirement were I need to run SignalR server in Xamarin app, and consume it in web app. As far as I have seen in examples, Xamarin is used as a client consuming the SignalR. Can anyone help me how to register and start SignalR in Xamarin like we do in dotnet core app as below
services.AddSignalR();
app.UseSignalR(routes => {
routes.MapHub<HubName>("path");
});
Is there a way were I can run same/alternative code in Xamarin. Thanks
Solution 1:[1]
Your above code, those are used in asp.net core webapp. What I currently know is that you can use SingalR Self-Host to achieve your needs, but it seems that .net core cannot be used, because the official documents are based on .net framework.
Official sample uses the console application, and this article uses windows service.
By using Microsoft.AspNet.SignalR.SelfHost
package can achieve your needs.
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 | Jason |