It looks like you are trying to broadcast a message from the server-side code by creating an instance of the hub. Unfortunately, this is not so. You can see an example of sending messages from the server side here: https://github.com/SignalR/SignalR/wiki/Hubs . Take a look at the section “Broadcasting through a hub from outside the hub”.
On the server side, where you want to broadcast from
the following will be used:
using SignalR.Infrastructure; string message = "Test Message"; IConnectionManager connectionManager = AspNetHost.DependencyResolver.Resolve<IConnectionManager>(); dynamic clients = connectionManager.GetClients<MyHub>(); clients.addMessage(message);
This is consistent with your Send() method, however, if you are trying to set up a progress indicator, you probably want to send messages only to the caller. In this case, you need to update the Progress method to Caller.addMessage("Starting to analyze image"); . Doing this from the outside of the hub is a bit more complicated, as you will need to keep track of the client ID for the connection you want to update. Once you find out that the above change:
clients[clientId].addMessage(message);
source share