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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With