Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception message: WebSockets is unsupported in the current application configuration

Just recently I upgraded to Windows 2012 Standard server 64bit so I can use web sockets.

I have added the role/feature via Server manager.

I had noticed in my windows log I had this message:

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>

So, I tried to add at the place the message told me. But I get this warning:

The 'targetFramework' attribute is not allowed.

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

But before I had added this I noticed I had this:

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

Is this not the same thing? If it is why do I get that warning.

I await to be educated...

like image 314
Andrew Simpson Avatar asked Mar 18 '23 21:03

Andrew Simpson


1 Answers

Have you enabled the module? http://danielhindrikes.se/windows-8/enable-websocket-protocol-in-iis/

enter image description here

Enable WebSocket Protocol in Windows 2012 server

  • Open “Server Manager”
  • Click on “Manage” in the right corner”
  • Click “Add Roles and Feature”
  • Go to “Installation Type in the Wizard”
  • Select “Role-based or feature installation and click “Next”
  • Go to “Server Roles”
  • Expand “Web Server(IIS)”
  • Expand “Web Server”
  • Expand “Application Development”
  • Check WebSocket Protocol and click “Next”
  • Click on “Install”

In my Web.config I have:

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

So it may be related with this? Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive or that you are doing the editing from VS2010

like image 152
vtortola Avatar answered Apr 08 '23 20:04

vtortola