Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I follow sample from 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'm getting:

'System.Web.Routing.RouteCollection' does not contain a definition for 'MapHubs' and no extension method 'MapHubs' accepting a first argument of type 'System.Web.Routing.RouteCollection' could be found (are you missing a using directive or an assembly reference?) \Global.asax 11

What am I doing wrong?

like image 382
cnd Avatar asked Feb 28 '13 08:02

cnd


1 Answers

Maphubs is an extension method to RouteCollection class in SignalR library. You would need to include SignalR references to call MapHubs.

Source:

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

like image 172
Srikanth Venugopalan Avatar answered Sep 19 '22 10:09

Srikanth Venugopalan