6
votes

I have developed a web app using SignalR and its working perfectly on my development server. But for some unknown reasons its not working on production server.

I have done some tests:

$.connection.hub.start().done(function () {

        console.log('started');

});

This always gives my 'started' in console as expected. So client and server are connected. But when I send any data like login credentials, i am not receiving anything back.

Here is the connection frames image. As you can see client is sending data to server but not receiving anything in response.

enter image description here

public override Task OnConnected()
{

        Clients.All.Listen("Connected to HUB");

}

CLIENT SIDE Listen method:

hub.client.listen = function (response) {

    console.log('Listen', response);

}

There is a Listen method which I use to debug. This doesn't print anything. So signalr client server are not connecting.

EDIT:

Reported issue here: https://github.com/SignalR/SignalR/issues/4279 if this helps.

EDIT2:

My webapp is a Vue js 2 app. I compiled using vue-cli and uploaded to server. My signalr.js file is copied from an ASP.NET MVC project.

I made a Test ASP.NET MVC 5 app with SignalR 2.4 and I was able to communicate on live server.

1
Can you share minimal visual studio solution to reproduce the issue? IT is working fine for me with SignalR 2.0Dipen Shah
Please mention your production server, is it IIS or Azure App Service or Azure SignalR Services?Azaz ul Haq
@AzazulHaq noneWaleed
Then what should I assume about the server mentioned in question. "its not working on production server"Azaz ul Haq
2 things to consider: Is there a chance your minification is renaming the listen callback in your production server? Does your production server have WebSockets enabled?reckface

1 Answers

0
votes

https://docs.microsoft.com/en-us/aspnet/signalr/overview/testing-and-debugging/troubleshooting

IIS issues

This section contains issues with Internet Information Services.

SignalR works on Visual Studio development server, but not in IIS

SignalR is supported on IIS 7.0 and 7.5, but support for extensionless URLs must be added. To add support for extensionless URLs, see https://support.microsoft.com/kb/980368

SignalR requires ASP.NET to be installed on the server (ASP.NET is not installed on IIS by default). To install ASP.NET, see ASP.NET Downloads.