Andrew dh Andrew dh - 3 months ago 55
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
$.connection.hub.start()
. On my local and on an old VPS this is fine, but when I go to Azure I get:

WebSocket connection to 'wss://www.example.com/signalr/connect?transport=webSockets&connectionToken=…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

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

<system.web>
    <httpRuntime targetFramework="4.5" />
</system.web>