Question

I have SignalR running in a web role in Azure. It has been working perfectly fine for about a year. However, after updating to VS2013 and updating all packages, it seems as if my SignalR hub is not being created when deployed to Azure. When surfing to http://mysite.cloudapp.net/signalr/hubs I get a "Value cannot be null. Parameter: key" error, and the client can also not connect.

However, it still works perfectly fine in the Azure dev fabric on my machine.

What could be wrong? I have a Startup class where SignalR is registered:

[assembly: OwinStartup(typeof(MyNamespace.Startup))]
namespace MyNamespace
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
        }
    }
}

OWIN is updated to 2.1.0.0 via NuGet.

Is there anything more I need to do to get the hubs created in the Azure production environment?

Was it helpful?

Solution 2

The solution was to re-create the web role project in Visual Studio and manually add back all of the code. A likely culprit is the web.config and how it is modified and then re-modified when updating and installing NuGet packages, although I can't be certain. But it worked perfectly when starting fresh from a new Visual Studio project (with the same code).

OTHER TIPS

Maybe you should enable WebSockets on Azure if you didn´t do it yet. As per asp.net site:

Enabling WebSockets on Azure Web Sites

WebSockets needs to be explicitly enabled in Azure Web Sites to be used in a SignalR application; otherwise, other protocols will be used (See Transports and Fallbacks for details).

Note that WebSockets is only available on Basic and Standard tier Azure Web Sites, and that the number of active Web Socket connections is restricted for Basic tier sites. See Web Sites Pricing Details for more information.

In order to use WebSockets on Azure Web Sites, enable it in the configuration section of the site. To do this, open your web site in the Azure Management Portal, and select Configure. At the top of the configuration page, ensure that .NET 4.5 is used for your web site. At the bottom of the Configuration page, select Save to save your changes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top