我的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);
}
}
在signalR / hubs中,未注册Notify方法
proxies.myHub = this.createHubProxy('myHub');
proxies.myHub.client = {};
proxies.myHub.server = {};
答案 0 :(得分:0)
我已从Notify功能中删除了静态属性。她现在显示在signalR / hubs
中