title: Self hosted SignalR method not called
body: <p>I am new to SignalR and having a bit of difficulty using a SignalR hub in a self hosted scenario.
  At the moment (just for testing) I have the simplest hub possible:</p>
  
  <pre><code>public class NotificationsHub : Hub
      {
          public void Hello(string name)
          {
              Clients.All.hello("Hello " + name);
          }        
      }
  </code></pre>
  
  <p>This hub class is in a Class Library project which is referenced in a Windows Service application. I've added all the nuget packages to the Windows Service app and added the OWIN Startup class which looks like this:</p>
  
  <pre><code>public class Startup
      {
          public void Configuration(IAppBuilder app)
          {            
              AppDomain.CurrentDomain.Load(typeof(NotificationsHub).Assembly.FullName); // as selfhosting doesn't scan referenced libraries for Hubs
              app.Map("/signalr", map =&gt; {
                  map.UseCors(CorsOptions.AllowAll);
                  var hubConfig = new HubConfiguration { 
                      EnableDetailedErrors = true,
                      EnableJSONP = true
                  };
                  map.RunSignalR(hubConfig);
              });
          }
      }
  </code></pre>
  
  <p>In the Windows Service OnStart method I host the signalR using:</p>
  
  <pre><code>SignalR = WebApp.Start&lt;Startup&gt;("http://*:9191/");
  </code></pre>
  
  <p>In the ASP.NET MVC app which should interact with SignalR I have the following code:</p>
  
  <pre><code>&lt;script src="Scripts/jquery.signalR-2.1.1.min.js"&gt;&lt;/script&gt;
  &lt;!--Reference the autogenerated SignalR hub script. --&gt;
  &lt;script src="http://localhost:9191/signalr/hubs"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
          $(function () {
              $.connection.hub.url = "http://localhost:9191/signalr";
              var notif = $.connection.notificationsHub;
  
              notif.client.hello = function (msg)
              {
                  alert(msg);
              }
  
              $.connection.hub.start().done(function () {
                  $("#sayHello").click(function () {
                      notif.server.hello($("#myName").val());
                  });
              });
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>The problem is this doesn't work in my correct setup... in the browser console I have no errors, the ~/signalr/hubs js looks fine... 
  If I do more or less the same configuration, but host the SignalR in the ASP.NET MVC app, everything works as expected.</p>
  
  <p>UPDATE: following @halter73 's suggestion to enable the client side logging for the hub, I've got the following error message which I still can't fix:</p>
  
  <blockquote>
    <p>SignalR: notificationshub.Hello failed to execute. Error: Method not
    found: 'Microsoft.AspNet.SignalR.Hubs.IHubCallerConnectionContext
    Microsoft.AspNet.SignalR.Hub.get_Clients()'.</p>
  </blockquote>
  
  <p>Could somebody please let me know what I am missing?</p>
  
  <p>Thank you in advance!</p>
  
  <p>Andrei</p>