Answer the question
In order to leave comments, you need to log in
Why is the SignalR hub not being added?
Hello. I am learning to write ASP.NET Core WEB API applications and I need to stream data from server to client. I read on the Internet how this can be done. It was written there that you need to use SignalR. Well, I added a class library project to my solution created before, in it I created a folder for storing SignalR hubs:
Then I created a hub class and inherited it from Hub:
public class RemoteLoggingHub : Hub
{
public async Task Log(string logMessage)
{
await this.Clients.All.SendAsync("Send", logMessage);
}
}
builder.Services.AddSignalR();
app.MapHub<RemoteLoggingHub>("/hubs/serverlogging");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question