就在最近,我升级到Windows 2012标准服务器64位,因此我可以使用网络套接字。
我已通过服务器管理器添加了角色/功能。
我在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">
这不是一回事吗?如果是为什么我会收到警告。
我等待接受教育......
答案 0 :(得分:6)
你启用了模块吗? http://danielhindrikes.se/windows-8/enable-websocket-protocol-in-iis/
在Windows 2012服务器中启用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进行编辑