flofreelance
flofreelance

Reputation: 944

signalR/hubs doesn't show hub method

I have this class in my asp mvc project

[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

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

Upvotes: 1

Views: 290

Answers (1)

flofreelance
flofreelance

Reputation: 944

I've removed the static attribute from the Notify function. She is now displayed in signalR/hubs

Upvotes: 1

Related Questions