【问题标题】:Exception message: WebSockets is unsupported in the current application configuration异常消息:当前应用程序配置不支持 WebSockets
【发布时间】:2014-11-18 12:11:16
【问题描述】:

最近我升级到了 64 位 Windows 2012 标准服务器,所以我可以使用 Web 套接字。

我已经通过服务器管理器添加了角色/功能。

我注意到在我的 Windows 日志中我收到了这条消息:

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 18/11/2014 11:51:12 
Event time (UTC): 18/11/2014 11:51:12 
Event ID: 5261ba8b0e5343289d5fc8618adb8117 
Event sequence: 113 
Event occurrence: 1 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/1/ROOT-1-130607850516111864 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: D:\Release\WebRoot\ 
    Machine name: DSVR019492 

Process information: 
    Process ID: 660 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL\.NET v4.5 

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>

所以,我尝试在消息告诉我的地方添加 。 但我收到了这个警告:

The 'targetFramework' attribute is not allowed.

 <system.web>
        <httpRuntime targetFramework="4.5.1" />

但在我添加这个之前,我注意到我有这个:

  <system.web>
    <compilation debug="true" targetFramework="4.5.1">

这不是一回事吗?如果这就是为什么我会收到该警告。

我等待接受教育...

【问题讨论】:

    标签: iis websocket web-config


    【解决方案1】:

    您是否启用了该模块? http://danielhindrikes.se/windows-8/enable-websocket-protocol-in-iis/

    在 Windows 2012 服务器中启用 WebSocket 协议

    • 打开“服务器管理器”
    • 点击右上角的“管理”
    • 点击“添加角色和功能”
    • 转到“向导中的安装类型”
    • 选择“基于角色或功能安装,然后单击“下一步”
    • 转到“服务器角色”
    • 展开“Web 服务器(IIS)”
    • 展开“网络服务器”
    • 扩展“应用程序开发”
    • 勾选WebSocket协议,点击“下一步”
    • 点击“安装”

    在我的 Web.config 中,我有:

      <system.web>
        <compilation debug="true" targetFramework="4.5.1" />
        <httpRuntime targetFramework="4.5.1" />
      </system.web>
    

    所以这可能与此有关? Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive 或者您正在从 VS2010 进行编辑

    【讨论】:

    • 您好,感谢您的回复。是的,我已经做了所有这就是为什么我感到困惑。顺便说一句,很好的说明:)
    • 您好,我尝试了您的建议,但我担心同样的警告。我现在看看那个链接。谢谢
    猜你喜欢
    • 1970-01-01
    • 2011-04-15
    • 2022-10-21
    • 1970-01-01
    • 1970-01-01
    • 2017-12-02
    • 2019-04-30
    • 2011-01-04
    • 1970-01-01
    相关资源
    最近更新 更多