小编R3v*_*rse的帖子

SignalR 无法启动连接

我有一个 Angular 应用程序以及使用 SignalR 的 ASP.NET Core 2.2 后端。启动连接时,我收到错误:

Error: Failed to complete negotiation with the server: Error
Error: Failed to start the connection: Error
Run Code Online (Sandbox Code Playgroud)

点击 localhost:5000/chatHub- 时的响应标头

HTTP/1.1 204 No Content
Date: Tue, 19 Feb 2019 08:52:52 GMT
Server: Kestrel
Access-Control-Allow-Headers: x-requested-with
Access-Control-Allow-Methods: POST
Access-Control-Allow-Origin: *
Run Code Online (Sandbox Code Playgroud)

Startup.cs-

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using RealChat.Hubs;

namespace RealChat
{
public class Startup …
Run Code Online (Sandbox Code Playgroud)

c# signalr asp.net-core asp.net-core-2.0

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

asp.net-core ×1

asp.net-core-2.0 ×1

c# ×1

signalr ×1