httpRuntime targetFramework issues in ASP.NET MVC Application

222 views Asked by At

Currently trying to implement SignalR in my ASP.NET MVC application. When I specify that I want it to use web sockets in the client as shown below:

 $.connection.hub.start({ transport: ['webSockets'] })
        .then(init)
        .then(function() {
            console.log('Hub Started Successfully!');
        });

I get an error saying that web sockets are not supported and I need to add the following line to my config file:

<httpRuntime targetFramework="4.5.1" />

Here's the exact error:

 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>

When I do, my async await for partial views stops working and I get the following error:

InvalidOperationException: HttpServerUtility.Execute blocked while waiting for an asynchronous operation to complete.

This error doesn't happen when I remove the runtime target framework line from the config file.

The ASP.NET MVC project runs on .NET 4.7.1 framework and the server / local dev machine has a runtime of 4.0 installed on it.

Any help would be greatly appreciated. Thank you in advance!

0

There are 0 answers