loading...

SignalR : ERR_CONNECTION_REFUSED Using ASP.NET Core 3.1 (make sure server is up)

jwp profile image John Peters Updated on ・1 min read

When the scaffolding for both client and server is set up for SignalR. The first thing on the client side is to attempt to connect to the Hub.

Negotiate Error

Our first attempt to connect to the server hub.

Alt Text

Analysis

Alt Text

//But chrome showed this

Request URL: https://localhost:8081/Hub/ClientStatus/negotiate

Response: XHR negotiate (failed) ERR_CONNECTION_REFUSED xhr

The root cause of this days long error was that you cannot use the old signalr client libraries found in ASP.NET.

// do not use this one in a .net core application!
npm i @asp.net/signalr
// Use this one.
npm i @microsoft/signalr

OR

Make sure your server is up an running. If negotiation attempts show red, nobody is responding!

JWP2020 npm i @microsoft/signalr

Posted on by:

jwp profile

John Peters

@jwp

Lit-Html or Svelte?

Discussion

pic
Editor guide