SignalR not working when machine key is added to web.config

When adding the machine key to the web.config file in my project, I consistently get the following error logged in the console while creating the hub

SignalR connection failed: Error: You are using a client version that is incompatible with the server. Client version 1.4, server version undefined.

Removing the machine key and it works fine

Below is the js code (works fine without the machine key present)

   $(function () {
        $.connection.hub.logging = true;
        var userHub = $.connection.userTracingHub;

        userHub.client.CompletedProcessing = function (model) {
            if (model) {
                alert("Order was successful");
            } else {
                alert("Order was unsuccessful");
            }
        };

        $.connection.hub.start().done(function () {
            $.connection.userTracingHub.server.hello();
            alert("connection set up");
        }).fail(function (reason) {
            console.log("SignalR connection failed: " + reason);
        });
    });    

      

The machine key is set as follows:

<machineKey decryption="Auto" decryptionKey="xxxx,IsolateApps" validation="3DES" validationKey="xxxx,IsolateApps" />    

      

Where xxxx is the key I put in.

I thought it might be due to the zoom mode not being configured, but I also tried to configure it to use the redis server to adjust the zoom mode and still have the same error

Thanks, Advance, Joel

+3


source to share


1 answer


I had the same error and then removing the IsolateApps option solved the problem. If you are using IIS Manager to generate a machine key, uncheck the Generate a unique key for each application check box, or simply remove the "IsolateApps" part from the web.config file.



Hope this helps!

0


source







All Articles