Questions tagged [signalr]

ASP.NET SignalR is a library for ASP.NET developers that makes it simple to add real-time functionality to your web applications. That is, to have your server-side code push content to the connected clients as it happens, in real-time.

SignalR is an asynchronous library for .NET to help build real-time, multi-user interactive web applications.

SignalR lets you communicate with clients on your website in real time through the best continuous connections available between browser and server (WebSocket between Chrome and IIS 8, but long polling between Internet Explorer 9 and IIS 7.5).

SignalR allows you to call methods from the server on the client (.NET , JavaScript, Java) and reciprocally. You can invoke methods on every client or a subset of clients.

Extensive documentation and guides are found here.

SignalR can be downloaded through NuGet here.

The source code is available on GitHub.

The JavaScript client package (jQuery plugin)

9391 questions
3
votes
1 answer

Unable to connect to ASP.NET SignalR hub from JavaScript client

I need to connect to an ASP.NET SignalR hub from JavaScript. I am using the @aspnet/signalr npm package, with the following code to connect. connection = new signalR.HubConnectionBuilder() .withUrl("", { accessTokenFactory: () =>…
zane
  • 107
  • 1
  • 11
3
votes
0 answers

SignalR - Connection stopped when multiple tabs are opened - Message is incomplete

On the frontend of my application I use the @microsoft/signalr library to send off requests to my backend hubs. This works okay in a single tab, but when a second tab is open an error is outputted to the console of the first tab and the connection…
Jamie Mclaughlan
  • 845
  • 2
  • 10
  • 29
3
votes
3 answers

SignalR hub repeated connection POST requests

I have an asp.net core 3.1 web app that uses SignalR, and I'm experiencing weird repeating requests from my web clients, e.g.: I have no idea why these are happening, AFAIK there isn't any code on the client side that should cause this. I've also…
Tamás Deme
  • 2,194
  • 2
  • 13
  • 31
3
votes
0 answers

SignalR Cookie Authentication Not Working In Blazor Server

Here I have simple private chat application in blazor server signalR where user logins, addfriend and chat with that friend. For login I have used AspNetCore.Identity. Now, the problem is that the application works perfectly fine in local machine…
sudip chand
  • 225
  • 6
  • 14
3
votes
1 answer

Adding/removing users to signalR groups in .NET 5.0

The following code has been working in .netcoreapp3.1 but it stopped working after migrating the Http-triggered function to .NET 5.0: public static class AddToGroup { [Function("addtogroup")] public static Task Run( …
Arash
  • 3,628
  • 5
  • 46
  • 70
3
votes
1 answer

Check if a group contains any client

Context I have the following workflow to let the server query data from a connected client: // Server-side code async Task RequestDataFromClient(string groupName) { var responseId = GenerateUniqueId(); // let the clients know that…
Nico Schertler
  • 32,049
  • 4
  • 39
  • 70
3
votes
1 answer

Blazor WebAssembly SignalR HubConnection causing javascript error on reload

I have a SignalR HubConnection within my Blazor WebAssembly application and whilst it works most of the time, if I reload the page (via the browser reload) then I often am getting the following error in the console and the connection is not…
oatsoda
  • 2,088
  • 2
  • 26
  • 49
3
votes
1 answer

Getting client IP from SignalR Connection

I am aware this question has been asked before. But in the ~8 years since, SignalR has changed rather a lot. So does anyone know how to get the IP of a client from the SignalR hub? I am using SignalR to communicate between two .net core applications…
3
votes
1 answer

SignalR multi user live chat desynchronisation

I have a live chat in which multiple people would be connected simultaneously. All public messaging works fine, but sometimes private messaging to a specific id doesn't work. I believe i narrowed it down to when people disconnected and reconnected…
Hazonko
  • 1,025
  • 1
  • 15
  • 30
3
votes
0 answers

SqlTableDependency referenced entity 'INSERTED' was modified during DDL execution

IDE used: Microsoft Visual Studio Community 2019 Language used: Asp.net with c# (Razor Pages) Libraries used: SignalR SqlTableDependency Issue explanation: The initial calling for the database is running totally fine without any errors and the…
Mr. Solver
  • 117
  • 1
  • 2
3
votes
0 answers

Detect dead connections with SignalR

SignalR version: SignalR 2.4.1 .Net Framework version: 4.8 (I am not using .Net Core) SignalR transport: websockets I am developing a background service for SignalR (PresenceMonitor) where I need to detect whether a connection with specific clientid…
Raghav
  • 8,772
  • 6
  • 82
  • 106
3
votes
1 answer

access Context.ConnectionID outside of hub in SignalR

I want to be able to send message to specific user account with SignalR. Right now I can send to everyone! I am looking for any way to have access to context.ConnectionID in controller outside of hub. I tried accessing it inside of controller with…
3
votes
0 answers

SignalR Error: Failed to start the connection: Error: None of the transports supported by the client are supported by the server

I am trying to use SignalR in my .NET CORE 3.1 webapi(server) and angular 10(client) project. API (https://localhost:44305/api) and client angular (https://localhost:44305/user/signup) project shares same domain. This is how I have setup signalR in…
sharmila
  • 65
  • 6
3
votes
1 answer

Thread doesn't start when app is running on Amazon windows server

I manually start thread which runs SignalR on one page. Currently my app is running on two different servers - Contabo and Amazon. Both are windows servers. I logged the whole process in my database and found out that the thread doesn't start on…
Guga Todua
  • 462
  • 2
  • 11
  • 27
3
votes
2 answers

How do I add SignalR to a .NET Core Windows Service?

I can find tutorials to add it to MVC, and even from 2014, an article explaining how to add it to .NET 4.7 windows service. However with a .NET Core 3.1 windows service, I just cannot figure out how to do it. Most tutorials seem to revolve around a…
NibblyPig
  • 51,118
  • 72
  • 200
  • 356