错误:无法完成与服务器的协商:错误:SignalR

问题描述

我正在使用 Visual Studio 2019 并在 .NET 5 框架的 MVC 项目中实现 SignalR 5.0.0.0。但不幸的是,我总是收到连接错误。你能帮帮我吗?顺便说一句,它适用于具有 SignalR 版本 3.1.0 的 .net 5。

SignalR 版本片段:

SignalR Version 5

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());
});

以下是浏览器错误

Browser error

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...