gpt4 book ai didi

azure - 部署到 Azure 时未注册 SignalR 集线器

转载 作者:行者123 更新时间:2023-12-03 04:35:43 24 4
gpt4 key购买 nike

我在 Azure 中的 Web 角色中运行 SignalR。它已经完美地工作了大约一年。但是,更新到 VS2013 并更新所有包后,部署到 Azure 时似乎没有创建我的 SignalR 集线器。当浏览到http://mysite.cloudapp.net/signalr/hubs时我收到“值不能为空。参数: key ”错误,并且客户端也无法连接。

但是,它在我的计算机上的 Azure 开发结构中仍然运行得很好。

可能出了什么问题?我有一个 Startup 类,其中注册了 SignalR:

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

OWIN 通过 NuGet 更新到 2.1.0.0。

我还需要做些什么才能在 Azure 生产环境中创建集线器吗?

最佳答案

也许您应该在 Azure 上启用 WebSockets(如果您还没有这样做)。根据 asp.net 站点:

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.

关于azure - 部署到 Azure 时未注册 SignalR 集线器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25089119/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com