iLemming
iLemming

Reputation: 36166

SignalR namespace conflict? Can't use MapHubs()

Trying to update signalr libs in my project, and suddenly solution doesn't build.

I have references to these guys:

Microsoft.AspNet.SignalR.Core.dll
Microsoft.AspNet.SignalR.SystemWeb.dll

I have this in global.asax:

using System;
using System.Web;
using System.Web.Routing;

Intellisense sees that RouteTable.Routes.MapHubs() comes from SignalRRouteExtensions, but still breaks the build. Project is .net 4.0 MVC 3 app. Should not have any problems.

Do you guys have any ideas why this is happening?

Error 71 '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.cs

Upvotes: 1

Views: 7537

Answers (2)

Batavia
Batavia

Reputation: 2497

Also i found that when using the unstable 2.0.0-beta releases this happened. when downgrading to 1.1.3 then it worked fine.

Upvotes: 2

halter73
halter73

Reputation: 15234

Did you manually reference the SignalR dll's instead of installing via NuGet? If so, I would suggest making sure your Microsoft.AspNet.SignalR.SystemWeb.dll is targeted to .NET 4.0 instead of 4.5. SignalR provides different versions of that assembly.

You can use Reflector or ildasm to help you with this. Just look at the assembly's TargetFrameworkAttribute::.ctor(string) in the Manifest and make sure it contains ".NETFramework,Version=v4.0".

Upvotes: 4

Related Questions