How to use SignalR in ASP.Net Core

Take advantage of SignalR to add real-time web functionality to your ASP.Net Core applications

SignalR for ASP.Net Core is a new version of the SignalR library that enables you to implement real-time communications in ASP.Net Core applications. Here the term “real-time” means that the server application can push data or content to connected clients as soon as updates happen, without clients having to request them. You can learn more about SignalR from my earlier post on SignalR for ASP.Net.

Note that SignalR for ASP.Net Core drops some of the features found in SignalR for ASP.Net (including automatic reconnects, support for progress messages, multiple hubs per connection) but is more robust and easier to use. As a result, this new version is not compatible with its predecessor. Note too that the new SignalR client is based on TypeScript. 

In this article we’ll look at how we can work with SignalR in ASP.Net Core. We’ll create a simple server that broadcasts text messages to clients, and a console application that consumes the messages. 

Create an ASP.Net Core project and install SignalR

First off, create a new ASP.Net Core project in Visual Studio. Assuming that you’re running Visual Studio Community Edition 2017 and .Net Core is already installed in your system, follow these steps to create an ASP.Net Core application.

To continue reading this article register now