For .Net core webapi and angular, Signalr response not getting client side from server side when SignalR client has connected to server

Satva Solutions 1 Reputation point
2021-03-16T04:23:18.617+00:00

I have created one web application using .Net core web api as backend side and angular8 as front-side.

Now we implemented signalr feature.

sometimes signalR not working, when SignalR client has connected to the server but gets no message from the server.

I added my signalR backend code as backend side as follows.

await hubContext.Clients.Client(userSignalrCnnectionID).SendAsync("updatescards", cardupdates)

I already checked some property after send signalr for both cases(when signalr working or when signalR not working) like Status(its value "RanToCompletion"), IsCompleted(its value true), IsCompletedSuccessfully(its value true), IsFaulted(its value false), IsCancelled(its value false).

Please let me know why sometimes not getting response message from front-side(i checked not getting any exception from backend code)

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,189 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Wang-MSFT 1,051 Reputation points
    2021-03-16T08:33:44.997+00:00

    Hi, @Satva Solutions
    It's hard to provide userful information for your case. I suggest you could gather more diagnostics from your application to help troubleshoot issues. The details you could check this article Logging and diagnostics in ASP.NET Core SignalR.

    In the default configuration, SignalR logs very little information, but this can configured. See the documentation on ASP.NET Core logging for details on configuring ASP.NET Core logging.

    ------
    If the answer doesn’t solve your issue, please provide more details of error that will help us track down what’s happening.
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,
    Michael Wang