I am trying to deploy a SignalR site on IIS. Code all works fine in VS. But getting the 404 not found error trying to resolve signalr/hubs so far I have tried.
1) Changing the Script ref to:
script src="<%= ResolveUrl("~/signalr/hubs") %>" type="text/javascript"></script>
2) Modifying Web.Config to include :
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
</modules>
</system.webServer>
3) Changing the invoke requests on IIS for UrlMappingsModule
.
4) added SignalR.Hosting.AspNet.dll
to see if that would help anything.
Not sure what else to try or check, any help or point in the right direction?
If you are working on webforms, Please take the following steps
In the webconfig:
In the page add reference to hub as
instead of
Similar problem I had on IIS version, I fixed it by restarting AppPool, restart web and its working now.
there are potentially many causes of this 404 - a few common ones can be found by
Try adding a wildcard application map to your server to help map the unknown extension in the script URL "~/signalr/hubs"
The reason of this 404 error is hubs are not mapped, previously it would have to be done as answered by SimonF. If you are using SignalR version 2
RouteTable.Routes.MapHubs();
is now obsolete. For mapping hubs you can create a startup class as below.referenace : http://www.asp.net/signalr/overview/releases/upgrading-signalr-1x-projects-to-20
Make sure your site's AppPool targets the correct version of .NET Framework.