First of all, can you show us your startup class where you call MapSignalR()
?
Assuming that you have done that correctly, the first thing that I see that is off is the following:
var hub = $.connection.MoveShapeHub;
The "/signalr/hubs" script is responsible for defining $.connection.moveShapeHub
. Notice how moveShapeHub
is defined using the lower camel case convention common to JavaScript instead of the Pascal case convention common to C#.
This means that the above line should be modified to use the lower camel case convention:
var hub = $.connection.moveShapeHub;
If you would prefer to use Pascal case, you can do so by using the HubName attribute.
[HubName("MoveShapeHub")]
public class MoveShapeHub : Hub
A name specified by the HubName attribute won't be re-cased by the /signalr/hubs script. http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-javascript-client#getproxy
Secondly, you should be putting your client-side hub callbacks on $.connection.moveShapeHub.client
object instead of directly on $.connection.moveShapeHub
. This means that $.extend(hub, { //...
should be $.extend(hub.client, {
instead.
It is also concerning that you use an app root relative path for all your scripts except /signalr/hubs. This shouldn't be a problem if your app root is the root of the domain, but I would change the /signalr/hubs reference to also be app root relative to be safe.