【发布时间】:2021-04-26 11:08:58
【问题描述】:
我需要从 JavaScript 连接到 ASP.NET SignalR 集线器。我正在使用@aspnet/signalr npm 包,使用以下代码进行连接。
connection = new signalR.HubConnectionBuilder()
.withUrl("<link to hub>", { accessTokenFactory: () => token })
.build();
connection.start()
相同的代码可以连接到 ASP.NET Core SignalR 集线器,但对于 ASP.NET SignalR 集线器,它会返回以下错误:TypeError: Cannot read property 'length' of undefined at "HttpConnection"
这是不兼容版本的问题吗? @aspnet/signalr 包可以用来连接 ASP.NET SignalR 集线器吗?
【问题讨论】:
标签: c# asp.net signalr asp.net-core-signalr