0

I'm using signalR to build a real-time website. I have 2 hub:

  • NotificationHubCore
  • NotificationHub (inherits NotificationHubCore)

My solution includes 2 small projects : Domain & Web. I put NotificationHubCore in Domain, NotificationHub in Web.

Now, in the web section, I want to acess NotificationHubCore by using :

 GlobalHost.ConnectionManager.GetHubContext<NotificationHubCore>();

It always returns null to me.

My question is : how can I access to NotificationHubCore through NotificationHub.

I've tried:

var notificationHub = new NotificationHub();
GlobalHost.DependencyResolver.Register(typeof(NotificationHubCore), () => notificationHub);

But that way didn't work.

Can anyone help me please?

Thank you,

Redplane
  • 2,971
  • 4
  • 30
  • 59

1 Answers1

0

You may use SQL Server to distribute messages across a SignalR application that is deployed in two separate applications.

Create a new database for the backplane to use. You can give the database any name. You don’t need to create any tables in the database; the backplane will create the necessary tables.

Refer this article and section "Scaleout with SQL Server" for further details - why SignalR

One Developer
  • 99
  • 5
  • 43
  • 103