SignalR hub example sending chat messages in ASP.NET Core

Download our SignalR example written for ASP.NET Core which includes a SignalR hub that can receive messages from a client and sends messages back to either one, or all connected clients.

It also includes the front-end written in JavaScript that connects to the SignalR hub and outputs the messages sent back from the SignalR hub.

Software

This is the software that will need to be installed onto your machine.

Get the application working

You'll need to fill out the code example form. We will send you an email where you can download the code example.

Open the project in Visual Studio

Open up RoundTheCode.SignalR.sln in Visual Studio 2022.

C# coding challenges

C# coding challenges

Our online code editor allows you to compile the answer.

Start the project in Visual Studio. It will load up https://localhost:8802.

You should already get a message from the SignalR hub. Send a message to it and receive a message back.

Also try it out with different browsers to see what messages you receive for each one.

More information

Watch our video where we show you how to add SignalR to an ASP.NET Core app.

In-addition, read our tutorial for more information on how you can add real-time communication to your .NET app.