问题描述
我正在使用 Visual Studio 2019 并在 .NET 5 框架的 MVC 项目中实现 SignalR 5.0.0.0。但不幸的是,我总是收到连接错误。你能帮帮我吗?顺便说一句,它适用于具有 SignalR 版本 3.1.0 的 .net 5。
SignalR 版本片段:
SignalR 连接脚本如下:
var connection = new signalR.HubConnectionBuilder().withUrl("/pushNotificationHub").build();
connection.on("Recive",function (notification) {
$("#modal-title").text(notification.title);
$("#modal-content").text(notification.content);
$('#myModal').modal('show');
});
connection.on("Connect",function (connectionId) {
$("#CallerConnectionId").val(connectionId);
});
connection.start().catch(function (err) {
return console.error(err.toString());
});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)