3
votes

enter image description hereWe are not using asp.net MVC . We are using SignalR with C# backend and HTML5 page with js .

Our SignalR code works perfectly when deployed on Windows Server 2012 R2 with IIS 7.5.

Startup Code :

 public void Configuration(IAppBuilder app)
        {
            // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888
            app.MapSignalR();
        }

Js reference code :

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

Initializing code :

var hubEngine = $.connection.allEnginesHub;
        $.connection.hub.logging = true;
        $.connection.hub.start()

Now we are trying to deploy this solution on Windows 7 with IIS 7.5

And we get the error

SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g.

We have tried multiple solutions by altering the js script to ~/signalR/hubs as posted on this site and none of them seem to be solving our problem

1) http://www.codeproject.com/Questions/840675/Why-I-am-getting-the-error-signalr-hubs-not-found

2) Signalr/Hub not loading in IIS 7 but working correctly in Visual Studio

3) http://www.codeproject.com/Questions/753256/SignalR-Hub-with-Multi-Form

4) SignalR /signalr/hubs 404 Not Found

5) How do I get a SignalR hub connection to work cross-domain?

6) http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-javascript-client#manualproxy

We are unable to understand how to debug this issue or how to solve it.

We will keep adding details to the problem as requested .

1

1 Answers

0
votes

Try putting:

<script src="@Url.Content("~/signalr/hubs")" type="text/javascript"></script>

instead of:

<script src="signalr/hubs"></script>