Peter Chikov
Peter Chikov

Reputation: 151

Calling SignalR hub methods from a different project

In the solution I have a SignalR Server hub that users connect to. In the other project of the Server I want to call the Client methods. However SignalR Hub is not static, and if I declare a new SignalR hub class then it will have different connections then the original hub.

How can I reference the original SignalR hub in a different project?

Upvotes: 0

Views: 2018

Answers (1)

Use GlobalHost.ConnectionManager.GetHubContext<YourHubClass>() on which you can call Clients.

Upvotes: 0

Related Questions