2
votes

I know there are lots of questions about 404 error of /signalr/hubs folder and i read all of them but none of it is relevant with my problem.

Because normally my code is working on local machine and test server; but same code is not working on production server. This will make me crazy, i tried to recycle app pool, restart IIS or w3svc service but didn't help.

My web site is a secure web site and i think this may cause problem but i couldn't find any thing about running SignalR with SSL.

My project is ASP.Net Web Forms (Web site) and running on IIS 7 on Windows Server Version 6.0 (Build 6002, SP2). App pool is configured to run with .Net Framework version 4.0.30319

P.S: I had another https site which runs signalr without any problems. So i am very confused.

Edit: I had created another web site at same server and copied working codes from working server and tried; result was same. There is something (maybe configuration) about server or IIS.

Solution: This solution solved my problem too. Actually i had tried this but i got 500 Internal Server Error and gave up. Whatever this is this solution, so i want to change my question what is purpose of this code? Why my site works at another server without this modification?

2
can u run ASP.NET MVC under the same host?tugberk

2 Answers

2
votes

Ensure that where you're hosting your site is where your signalr/hubs is pointing to. A common issue is that people will host their site like so:

www.abcd.com/mysite/index.html

Now in this example SignalR is hosted at www.abcd.com/mysite/signalr however a lot of people will put /signalr/hubs in their index.html which is wrong. It should be ~/signalr/hubs because the hubs file isn't hosted at www.abcd.com/signalr/hubs it's at www.abcd.com/mysite/signalr/hubs.

Hope this helps!

0
votes

Use <script src="<%: ResolveUrl("~/signalr/hubs") %>"></script>and that will resolve the problem