SignalR 在 IIS 上发布时不起作用

问题描述 投票:0回答:1

使用.net core 6。 代码在 Visual Studio 2022 上完美运行。

当应用程序在服务器 (iis) 上发布时,信号器功能停止工作。

java脚本:

const connection = new signalR.HubConnectionBuilder().withUrl("/checkproduct").build();

程序.cs:

app.MapHub<ProductHub>("/checkproduct");

错误信息:

Failed to load resource: the server responded with a status of 404 (Not Found)
signalr.js:3082 [2024-01-22T06:11:53.892Z] Error: Failed to complete negotiation with the server: Error: Not Found
[2024-01-22T06:11:53.893Z] Error: Failed to start the connection: Error: Not Found

.net signalr core
1个回答
0
投票

在 Windows 功能中,确保您已检查 WebSocket 协议,问题将会得到解决

© www.soinside.com 2019 - 2024. All rights reserved.