TheDude
TheDude

Reputation: 1531

Does the SignalR RouteTable.Routes.MapHubs(); absolutely have to be put in Application_Start()?

Can it be put in other custom named methods within Global.asax that start up first like OnApplicationStarted()? The dilemma I'm having is that our project has a custom class that the class in Global.asax is inheriting from instead of the standard "System.Web.HttpApplication". Which means I can't use the "Application_Start" method to put my SignalR Hubs routing in.

So my question is this: Is SignalR absolutely hardwired to use a method with the exact method name of "Application_Start" in the Global.asax? Thanks!

Upvotes: 0

Views: 4499

Answers (1)

Nikola Dimitroff
Nikola Dimitroff

Reputation: 6237

MapHubs simply creates the signalr/hub script. It doesn't matter where you generate it as long as it is generated before you attempt to use the script.

Upvotes: 1

Related Questions