Andrew dh Andrew dh - 1 year ago 226
ASP.NET (C#) Question

SignalR on Azure - 502 error on handshake

I've got a site running on Azure with the following components:

  • Mvc 5.1.2

  • SignalR 2.0.2

When my page loads, SignalR calls
. On my local and on an old VPS this is fine, but when I go to Azure I get:

WebSocket connection to 'wss://…7Au%2FeIQQh&connectionData=%5B%7B%22name%22%3A%22projecthub%22%7D%5D&tid=9' failed: Error during WebSocket handshake: Unexpected response code: 502

WebSockets is switched on, and .NET v4.5 is active. I've added logging and it's falling over at:

SignalR - 502 error

The error

I have no clue why __DynamicModule_System.Web.WebPages.WebPageHttpModule is failing. Does this make sense to anyone?

Answer Source

Found the solution - simple web.config change. Add the following:

    <httpRuntime targetFramework="4.5" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download