0

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.

  • Have you found a solution? I have upgraded from SignalR 2.0.2 to 2.1.1 and getting the same error.... – fenix2222 Aug 16 '14 at 05:01
  • sorry @fenix2222 - I ended up ditching SignalR and using ServiceStack's [Server Sent Events](https://github.com/ServiceStack/ServiceStack/wiki/Server-Events) – Ryan Britton Mar 20 '15 at 11:29

0 Answers0