I'm using Visual Studio 2012 Ultimate RC, SignalR 0.5.1 and Jquery 1.7.2 in an MVC4 application.
I have looked at: MVC4 SignalR "signalr/hubs" 501 Not Implemented Error
But it does not affect my issue (I am using IIS Express to debug).
When I try to utilize SignalR the $.connection variable is undefined. My server side code:
[HubName("tenantHub")]
public class TenantHub : Hub
{
...
void TenantChange(CrudAction action, Tenant tenant)
{
Clients.eventOccurred(action.ToString(), tenant);
}
}
Client side:
$(function() { var test = $.connection.tenantHub; });
Client side SignalR/hubs
is being referenced and I can see the JS code, it does not throw any errors. But referencing $.connection throws a Uncaught TypeError: Cannot read property 'tenantHub' of undefined
. Also tried to do the default chat example, it gives the same error. Is SignalR unsupported when utilized in VS2012 or am I just being stupid?
$.connection.hub.start();
That's all I can think of right now :( – Kentjquery.signalR-0.5.1.min.js
andsignalr/hubs
? Maybe you should try to debug it usingfirebug
– Kentjquery.signalR-0.5.1.min.js
andsignalr/hubs
are being referenced, not throwing any errors. – Bas