简体   繁体   English

signalR /集线器未显示集线器方法

[英]signalR/hubs doesn't show hub method

I have this class in my asp mvc project 我的ASP MVC项目中有此类

[HubName("myHub")]
public class MyHub:Hub
{
   [HubMethodName("Notify")]
   public static void Notify(string msg)
   {
      var hubContext = GlobalHost.ConnectionManager.GetHubContext<myHub>();
      hubContext.Clients.All.sendMessage(msg);
   }
}

In signalR/hubs the Notify method is not registered 在signalR / hub中,Notify方法未注册

proxies.myHub = this.createHubProxy('myHub'); 
proxies.myHub.client = {};
proxies.myHub.server = {};

I've removed the static attribute from the Notify function. 我已经从Notify函数中删除了static属性。 She is now displayed in signalR/hubs 现在,她显示在signalR / hub中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM