8
votes

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?

1

1 Answers

8
votes

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