I am receiving the following error when trying to send a signalr message from a HuContext (ie: from the server rather than another client). This was working in my original prototype, but has stopped working since I implemented the Backplane :
Method not found: 'Microsoft.AspNet.SignalR.Hubs.IHubConnectionContext Microsoft.AspNet.SignalR.IHubContext.get_Clients()'.
I have created some static methods on the Hub class to facilitate the firing of SignalR messages during processing (following an example I found). The Hub class currently looks something like this (similar methods removed for brevity) :
public class ImportFilesHub : Hub
{
public void ImportFileProgressChanged(ImportFileProgressChangedNotification notification)
{
Clients.All.ImportFileProgressChanged(notification);
}
public static void HubImportFileProgressChanged(ImportFileProgressChangedNotification notification)
{
IHubContext context = GlobalHost.ConnectionManager.GetHubContext<ImportFilesHub>();
context.Clients.All.importFileProgressChanged(notification);
}
}
I suspect that the reason I am getting this error is because this is the incorrect way to approach this type of requirement when using a backplane (since it worked in the prototype), but I have scoured the SignalR documentation and cannot find an alternative means for doing this.
I suppose that I could add the SignalR client classes to the server and connect the way a client would...but that doesn't seem like a very elegant approach.