2

I'm trying to use ASP.NET Signalr for the first time - here's what I've done: Created a new web project and added the following SignalR packages:

enter image description here

I've then created the following class:

[HubName("chat")]
public class ChatHub : Hub
{
    public void Hello()
    {
        Clients.All.hello();
    }
}

And the following startup configuration:

public partial class Startup
{
    public void Configuration(IAppBuilder app)
    {
        ConfigureAuth(app);
        app.MapSignalR();
    }
}

However whenever I navigate to

localhost:(port)/api/signalr/chat

I get the following error:

Protocol error: Unknown transport.

I'm running the latest browsers and have tried multiple different ones so what could be the issue?

3
  • 3
    You shouldn't need to navigate directly to that endpoint. You use javascript to connect to the hub: asp.net/signalr/overview/guide-to-the-api/… Oct 17, 2014 at 16:10
  • @LosFrijoles Ahh I see - thanks a lot! Oct 17, 2014 at 16:15
  • 12
    your hub script should be at /signalr/hubs, if your SignalR is working you'll be able to navigate to that page while your site is running. Oct 17, 2014 at 16:15

1 Answer 1

1

Remove the api/ from the url, and just use localhost:(port)/signalr/chat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.