将 ASP.NET Core SignalR 与 Blazor 结合使用:错误收到无效的协商响应

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

我按照此链接中的 T 说明进行操作。但我不断收到错误消息:

Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Invalid negotiation response received.

System.IO.InvalidDataException: Invalid negotiation response received.
 ---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
  
signalr-hub microsoft-identity-platform
1个回答
0
投票

Microsoft.Identity 和 SignalR 在 Blazor 应用程序上协同工作似乎存在问题。更多信息可以在这里找到:Blazor Server 和 SignalR 以及 Azure AD ...事实证明我只需要添加:

[AllowAnonymous()] //TODO: authorize...
    public class SignalrHub : Hub
    {

希望它对某人有帮助:)

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