【问题标题】:EventSource's response has a MIME type ("text/plain") that is not "text/event-stream". Aborting the connection Azure SignalREventSource 的响应具有不是“text/event-stream”的 MIME 类型(“text/plain”)。中止连接 Azure SignalR
【发布时间】:2020-01-30 14:53:05
【问题描述】:

EventSource 的响应有一个 MIME 类型(“text/plain”),它不是 “文本/事件流”。中止连接 Azure SignalR

我在 MVC c# 项目中不断收到错误,如何解决同样的问题

【问题讨论】:

    标签: c# jquery asp.net-mvc azure-signalr


    【解决方案1】:

    在 Startup.cs 上

    `

    public void ConfigureAuth(IAppBuilder app)
            {
                app.MapAzureSignalR(this.GetType().FullName);
                app.Map("/EnableDetailedErrors", map =>
                {
                    HubConfiguration hubConfiguration = new HubConfiguration
                    {
                        EnableDetailedErrors = true,
                        EnableJavaScriptProxies = false
                    };
                    map.MapAzureSignalR(this.GetType().FullName, hubConfiguration);
                    //map.MapSignalR(hubConfiguration);
                });
            }
    

    `

    【讨论】:

      猜你喜欢
      • 2016-08-30
      • 1970-01-01
      • 1970-01-01
      • 2019-02-07
      • 1970-01-01
      • 2018-01-31
      • 2012-06-02
      • 2022-11-29
      • 2020-09-20
      相关资源
      最近更新 更多