One cause of this error on an MVC app is failing to register a route for the hubs. Here's an example of doing that in a Global.asax.cs file in the app start method:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
// Add the following using statements.
using System.Web.Routing;
using Microsoft.AspNet.SignalR;
namespace SignalRChat_RC
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
// Register the default hubs route: ~/signalr/hubs
RouteTable.Routes.MapHubs();
}
}
}
This posting is provided "AS IS" with no warranties, and confers no rights.
Marked as answer by pantonis on Dec 14, 2012 02:54 PM
pantonis
Member
328 Points
260 Posts
Missing hubs from signalR connection
Dec 14, 2012 09:51 AM|LINK
I'm using MVC4 with signalr. I have just updated into signalr rc1 and my connection does not include the hubs
I get following error
Uncaught TypeError: Cannot read property 'client' of undefined
Please mark this post as answer if it helped you solve your problem
timlt
Member
88 Points
21 Posts
Microsoft
Re: Missing hubs from signalR connection
Dec 14, 2012 02:52 PM|LINK
One cause of this error on an MVC app is failing to register a route for the hubs. Here's an example of doing that in a Global.asax.cs file in the app start method:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Security; using System.Web.SessionState; // Add the following using statements. using System.Web.Routing; using Microsoft.AspNet.SignalR; namespace SignalRChat_RC { public class Global : System.Web.HttpApplication { protected void Application_Start(object sender, EventArgs e) { // Register the default hubs route: ~/signalr/hubs RouteTable.Routes.MapHubs(); } } }