0
我使用signalR構建實時網站。 我有2輪轂:ASP.NET Framework中Signalr的集線器繼承
- NotificationHubCore
- NotificationHub(繼承NotificationHubCore)
我的解決辦法包括2個小項目:域 & 的Web。 我把通域中的核心,NotificationHub在網絡。
現在,在網絡部分,我想通過接取NotificationHubCore:
GlobalHost.ConnectionManager.GetHubContext<NotificationHubCore>();
它總是返回null給我。
我的問題是:如何通過NotificationHub訪問NotificationHubCore。
我已經試過:
var notificationHub = new NotificationHub();
GlobalHost.DependencyResolver.Register(typeof(NotificationHubCore),() => notificationHub);
但這種方式沒有奏效。
任何人都可以幫助我嗎?
謝謝