System.Web.Routing.RouteCollection does not contain a definition for "MapHubs"

I follow the sample from the SignalR wiki page, and here is my Global.asax :

 <%@ Application Language="C#" %> <%@ Import Namespace="System" %> <%@ Import Namespace="System.Web.Routing" %> <script runat="server"> void Application_Start(object sender, EventArgs e) { // Code that runs on application startup RouteTable.Routes.MapHubs(); } 

But I get:

'System.Web.Routing.RouteCollection' does not contain a definition for "MapHubs" and no extension method "MapHubs" that takes the first argument of type "System.Web.Routing.RouteCollection" can be found (you are missing the using directive or the link to assembly?) \ Global.asax 11

What am I doing wrong?

+7
source share
1 answer

Maphubs is an extension method of the RouteCollection class in the SignalR library. You will need to enable SignalR links to call MapHubs.

A source:

https://github.com/SignalR/SignalR/blob/master/src/Microsoft.AspNet.SignalR.SystemWeb/SignalRRouteExtensions.cs

+8
source

All Articles