Milos Mijatovic Milos Mijatovic - 1 year ago 378
C# Question

/signalr/hubs 404 not found after update to MVC5

SignalR was working while project was ASP.NET MVC3. Now i upgraded it to MVC5 (not so easy to do, I must tell you).

Then I noticed that signalR was not working. I went by the book, reinstalled SignalR to version 2.1.0, installed OWIN (must-have for v2+) and added startup class to project.

This is my startup.cs class, it sits at project root folder:

[assembly: OwinStartup(typeof(SISTEM.Startup))]
namespace SISTEM
public class Startup
public void Configuration(IAppBuilder app)

I see no problem here, but maybe i am missing something...

Now here is snippet from the hub:

namespace SISTEM
public class PostingHub : Hub
public void Test(string hello)

Then i reference generated proxys in view:

<script src="~/Scripts/jquery.signalR-2.1.0.min.js"></script>
<script src="~/signalr/hubs"></script>

I inspect it in fiddler and i can see that /signalr/hubs request is generating HTTP 404 not found.

Now, i wasn't lazy, i tried several things:

  • Patch IIS for extensionless URLs - Shouldn't be a problem since I'm using win8

  • Call RouteTable.Routes.MapHubs() before RegisterRoutes(RouteTable.Routes) - VS won't allow it. Gives me an error saying that's obsolete, use OWIN.

  • Downloaded tool for generating javascript proxies (SignarR Utils), so i can manually reference them later. Tried to generate, went with no error, but generated js was empty. Tried several times. This was for me most interesting. Maybe for some reason proxy cannot be generated.

Any help would be appreciated.

UPDATE: Response from /signalr/hubs

<!DOCTYPE html>
<title>The resource cannot be found.</title>
<meta name="viewport" content="width=device-width" />

<body bgcolor="white">

<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

<h2> <i>The resource cannot be found.</i> </h2></span>

<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

<b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.

<b> Requested URL: </b>/signalr/hubs<br><br>

<hr width=100% size=1 color=silver>

<b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34212



[HttpException]: The controller for path &#39;/signalr/hubs&#39; was not found or does not implement IController.
at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Answer Source

You need to install Microsoft.Owin.Host.SystemWeb package in the project

Verify this link

If package is not installed then install the following package from the Package Manager Console (PMC):

Install-Package Microsoft.Owin.Host.SystemWeb


It purely says that, its not able to detect your startup class, here are few more findings.

  • I believe this key is no more exist in config file <add key="owin:AutomaticAppStartup" value="false" />
  • Your application might be cached in temp folder, try deleting temporary files for your application.(Go to run > %TEMP% > CTRL + A > Delete)

This should definitely work, if it doesn't then try creating signalR in sample project.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download