0
votes

I'm following this guide: http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-net-client#callserver

I have the following:

_hubProxy = _hubConnection.CreateHubProxy("appHub");
_hubConnection.Start().Wait();
_hubProxy.Invoke("SendNavbarMessage", _hubConnection.ConnectionId).Wait();

Originally, I had a complex type being passed vie Invoke, but to debug I'm trying to use a parameterless hub method. My hub:

[HubName("appHub")]
public class AppHub : Hub {
      // prep
    public void SendNavbarMessage() {
         // do stuff
    }
}

When I call Invoke(), I see the following error:

{"'SendNavbarMessage' method could not be resolved."}

This is with Detailed error messages enabled in the signalR configuration... I get no other details.

What am I doing wrong?

1

1 Answers

1
votes

Invoke sends one parameter to the method, but your Hub method has no parameters

_hubProxy.Invoke("SendNavbarMessage", _hubConnection.ConnectionId)

Should maybe be

_hubProxy.Invoke("SendNavbarMessage");