title: SignalR IHubContext.Clients.All is not triggering any calls nor throwing errors, what am I missing?
body: <p>My setup is the most simple imaginable, without even utilizing ajax functionality in this scenario. I just want to trigger a page refresh when some events happen (in an MVC4 app). This is what my hub looks like:</p>
  
  <pre><code>[HubName("signalingHub")]
  public class SignalingHub:Hub {
  
      [HubMethodName("invalidate")]
      public void Invalidate() {
          Clients.Others.invalidate();
      }
  }
  </code></pre>
  
  <p>Actually I'm never calling that Invalidate method (I'll probably remove it later to prevent clients from triggering the event). Instead I have a method elsewhere in the application that gets fired on an external event, and it calls <code>TriggerForMySpecialEvent</code> defined in Global.asax.cs:</p>
  
  <pre><code>public class MvcApplication : System.Web.HttpApplication {
  
      protected void Application_Start() {
          // initialize a separate thread that does some monitoring
          // and kicks off TriggerForMySpecialEvent() when needed
      }
  
      public static IHubContext hubContext;
  
      void TriggerForMySpecialEvent() {
          if (object.ReferenceEquals(hubContext, null)) // lazy load
              hubContext = GlobalHost.ConnectionManager.GetHubContext&lt;SignalingHub&gt;();
  
          try {
              hubContext.Clients.All.invalidate();
          } catch (Exception ex) {
              System.Diagnostics.Trace.WriteLine(ex.ToString());
          }
      }
  }
  
  public class Startup {
      public void Configuration(IAppBuilder app) {
          app.MapSignalR();
      }
  }
  </code></pre>
  
  <p>When putting a breakpoint on <code>hubContext.Clients.All.invalidate();</code> it is hit. The client code is simple, at the end of my (Razor) page I have:</p>
  
  <pre><code>@section scripts{
      &lt;script src="~/Scripts/jquery.signalR-2.0.3.min.js"&gt;&lt;/script&gt;
      &lt;script src="~/signalr/hubs"&gt;&lt;/script&gt;
  
      &lt;script&gt;
      $(function () {
          var hub = $.connection.signalingHub;
          $.extend(hub, {
              invalidate: function () {
                  window.location.href = '@Href("~")';
              }
          });
          $.connection.hub.start();
      });
      &lt;/script&gt;
  }
  </code></pre>
  
  <p>When running it in IIS Express via Visual Studio, I put a breakpoint on the javascript in the browser I see it being initiated, and I see some "long polling" going on. But the invalidate() function never gets called, no matter how many times my TriggerForMySpecialEvent() is fired. No errors are being logged, but the long-poll's keep on waiting for a few secconds before they refresh, without ever being cut off by any event. So it seems my global IHubContext is not connected to the SignalingHub that the clients are connected to? On the clients I see no javascript errors. What am I missing?</p>