I am trying to build a simple chat application using SignalR with ASP.NET Core 2.0.
The problem is that when I want to access one of my hub's url (localhost:5000/chat
) I receive as a response: Connection ID required
with error code 400
. I am using auto generated from template authentication (users are stored in local db).
Here are the following components:
Startup.cs
ChatHub.cs
Any help will be really appreciated. If you need any further information - please let me know.
The problem was that I have configured the hub at route /chat
while my ChatController was also responsible for it. After mapping the hub to different route than the controller's one everything went fine.
I changed this:
app.UseSignalR(routes => { routes.MapHub<ChatHub>("chat"); });
To this:
app.UseSignalR(routes => { routes.MapHub<ChatHub>("chatter"); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With