SignalR "Error during start request. Stopping connection."

Internal Errors From Fiddler:

The ConnectionId is in the incorrect format.

From Trace:

SignalR.Transports.TransportHeartBeat Information: 0 : Connection 75e8d0ef-

64e2-463e-935d-a16759d948f1 is New.
SignalR.HubDispatcher Information: 0 : Failed to process connectionToken yhoTZnFsEnKUbd1/67eByQPhUb 3xkOsYMBXLLvp8nI29NnXrJE5zqHoFgLtA2VxOUJMAOreX6 7FGK4cGbal446Gs5YiV9F8MBduVMEXooL9fSeGpPHThvw56p6CzGX2yNmy7sy014gnak9l3BlZw==: System.FormatException: Invalid length for a Base-64 char array or string.
   at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Microsoft.AspNet.SignalR.Infrastructure.DataProtectionProviderProtectedData.Unprotect(String protectedValue, String purpose)
   at Microsoft.AspNet.SignalR.PersistentConnection.TryGetConnectionId(HostContext context, String connectionToken, String& connectionId, String& message, Int32& statusCode)

This is a client call from the Apache Cordava App (Visual Studio) using rowan emulator, I use a hub, but some how it fails in PersistentConnection

http://localhost:4400/ripple/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rurl=http%3A//localhost%3A52374/signalr/abort%3Ftransport%3DwebSockets%26clientProtocol%3D1.5%26connectionToken%3D6FHV%252BT%252F0WSoC3R8EEaseIe2481KxD24%252Fa31Toitf9kqUmIZw4jd87DgBnLWtVbLDZkZJA5gnEhQAUchyECh78738dIpuhqy1W4hAEVut%252F0gHr1Ou5bmpWbRi29sqRpwA4Y7Wc4WJPjYMpRIemgzP9w%253D%253D%26connectionData%3D%255B%257B%2522name%2522%253A%2522messagehub%2522%257D%255D HTTP/1.1
Host: localhost:4400

My code is:

$.connection.hub.url = rooturl + "/signalr";
var chat = $.connection.messageHub;
$.connection.hub.start().done(function () {
                       $.connection.hub.disconnected(function () {
                           console.log('signlar connection abort');
                       });
                   }).fail(function (a) {
                       console.log('not connected' + a);
                   });
+4
source share
1 answer

I had the same error using the Ripple emulator and managed to solve it by following these steps:

1: Enable JSONP on the client, change the following

 $.connection.hub.start()

to

 $.connection.hub.start({ jsonp: true })

2. Enable JSONP on the server (C # in my case) in configuration mode at startup

app.MapSignalR(new HubConfiguration
        {
            EnableJSONP = true,
            EnableJavaScriptProxies = true,
            EnableDetailedErrors = true
        });
0
source

Source: https://habr.com/ru/post/1610629/


All Articles