Reputation: 20169
I running this super simple SignalR test app that I wrote in VS 2012 / MVC 4 / Win8.
When I run I get the following error everytime. For some reason it looks like it cannot load /signalr/hubs
JS.
What am I doing wrong? You can grab the solution from here.
http://andrewherrick.com/spike/SignalR_AJ_Hi.zip
Upvotes: 1
Views: 459
Reputation: 31250
Two things
RouteTable.Routes.MapHubs();
is included after RouteConfig.RegisterRoutes(RouteTable.Routes);
. It should be included before any other routes. SignalR FAQ.Global.asax.cs
(at least the version I downloaded). You can test this by inserting some invalid code in the file Global.asax.cs and the project would still compile. Exclude it it from the project. Do a clean and full rebuild. Include it back and then do a full rebuild. Make sure that you do get the compilation errors for the invalid code (so that you know that it is being compiled). Remove the invalid code and recompile.Upvotes: 3
Reputation: 18301
In your app start do:
RouteTable.Routes.MapHubs();
See the Why does signalr/hubs return 404 or Why do I get 'myhub' is undefined? section in: https://github.com/SignalR/SignalR/wiki/Faq
Upvotes: 1