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?
Try removing the BundleConfig.RegisterBundles(BundleTable.Bundles);
from Global.asax.cs, and see if that helps?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With