title: Connecting to SignalR from Chrome extension - error: method could not be resolved
body: <p>I'm building an Chrome extension that will interact with a SignalR HUB.</p>
  
  <p>The HUB is working fine with my local files which were created with the proxy connection. However, I can't use the proxy connection in the chrome extension because it's not in the same project so I had to define it myself:</p>
  
  <pre><code>var connection = $.hubConnection('http://localhost:61xxx/signalr/hubs', {useDefaultPath: false});
  var roomIndexHubProxy = connection.createHubProxy('roomIndexHub');
  </code></pre>
  
  <p>This works fine, and if I use a breakpoint on the server <code>OnConnected</code> method it does fire, and I also see that the log which says the connection was established. But when I try to run my own functions, I get this error (on client-side):</p>
  
  <blockquote>
    <p>SignalR: 'test' method could not be resolved. No method found with that name.     at Microsoft.AspNet.SignalR.Hubs.NullMethodDescriptor.b__0(IHub
    emptyHub, Object[] emptyParameters)    at
    Microsoft.AspNet.SignalR.Hubs.HubDispatcher.Incoming(IHubIncomingInvokerContext
    context)
    --- End of stack trace from previous location where exception was thrown ---    at
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
    task)    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
    task)    at
    System.Runtime.CompilerServices.ConfiguredTaskAwaitable<code>1.ConfiguredTaskAwaiter.GetResult()
    at
    Microsoft.AspNet.SignalR.TaskAwaiterHelper.PreserveCultureAwaiter</code>1.GetResult()
    at
    Microsoft.AspNet.SignalR.Hubs.HubPipelineModule.&lt;>c__DisplayClass1.&lt;b__0>d__3.MoveNext().</p>
    
    <p>SignalR:
    roomindexhub.test failed to execute. Error: 'test' method could not be
    resolved. No method found with that name.</p>
  </blockquote>
  
  <p>This is my client side code:</p>
  
  <pre><code>var connection = $.hubConnection('http://localhost:61xxx/signalr/hubs', {useDefaultPath: false});
  var roomIndexHubProxy = connection.createHubProxy('roomIndexHub');
  
  connection.logging = true;
  connection.start().done(function() {
      // Wire up Send button to call RoomIndexHubProxy on the server.
      console.log('Hub has started');
      $("#signalr").click(function(){
          roomIndexHubProxy.invoke('test');
      });
  
  });
  
  connection.error(function (error) {
      console.log('SignalR error: ' + error)
  });
  </code></pre>
  
  <p>server side code (although very simple):</p>
  
  <pre><code>public class RoomIndexHub : Hub
      {
          public RoomIndexHub(){}
  
          public override Task OnConnected()
          {
              return base.OnConnected();  // this works!
          }
  
          internal void test()
          {
              int i = 0;   // this doesn't work
          }
      }   
  }
  </code></pre>
  
  <p>As I'm writing those lines I see this `at Microsoft.AspNet.SignalR.Hubs.NullMethodDescriptor.b__0(IHub</p>
  
  <blockquote>
    <p>emptyHub, Object[] emptyParameters)`. </p>
  </blockquote>
  
  <p>However I dunno why this is happening since I did define:</p>
  
  <p><code>var roomIndexHubProxy = connection.createHubProxy('roomIndexHub');</code></p>
  
  <p>I would really appreciate your help!</p>