【问题标题】:SignalR: WebSockets is unsupported in the current application configurationSignalR:当前应用程序配置中不支持 WebSockets
【发布时间】:2015-05-30 20:07:15
【问题描述】:

我在我的项目中使用 SignalR 2.1.2。一切都很好,但是今天我看到通知在我的项目中不起作用。我试图解决问题所以我检查了 Windows 事件查看器并看到了这个error

Exception information: 
    Exception type: InvalidOperationException 
    Exception message: WebSockets is unsupported in the current application configuration. To enable this, set the following configuration switch in Web.config:
<system.web>
  <httpRuntime targetFramework="4.5" />
</system.web>....

我有很多关于这个问题的searched。如您所见,错误消息告诉我们设置targetFramework,但我没有得到任何结果。
PS:本地版本和发布版本都有这个问题。

【问题讨论】:

  • 也许您运行的是旧版本的 IIS?
  • 网站最近遇到这个问题。说明它之前在同一个IIS上没有这个问题。
  • 您运行的是什么版本的 IIS/Windows? Web Sockets 之前是否工作过,或者 SignalR 是否正在回退到另一个传输?
  • 您在项目中的目标是哪个版本的 ASP.NET,托管在哪个版本的 IIS 上,您使用哪个浏览器访问该页面?
  • @Stilgar IIS 8 和 Windows Server 2012

标签: asp.net iis signalr iis-express


【解决方案1】:

经过长时间的调试,我想通了。我只是忘了建立连接:

$.connection.hub.start()

});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-10-21
    • 2013-03-01
    • 2011-01-04
    • 1970-01-01
    • 2017-01-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多