Building a .NET console app client
You have just seen a .NET service hosting a SignalR hub, and a JavaScript client exchanging messages with other clients via that SignalR hub. Now, let’s create a .NET client for SignalR.
Creating a .NET client for SignalR
We will use a console app, although any .NET project type would need the same package reference and implementation code:
- Use your preferred code editor to add a new project, as defined in the following list:
- Project template: Console Application/
console
- Workspace/solution file and folder:
Chapter13
- Project file and folder:
Northwind.SignalR.Client.Console
- Project template: Console Application/
- Add a package reference for the ASP.NET Core SignalR client and a project reference for
Northwind.Common
, and globally and statically import theSystem.Console
class, as shown in the following markup:<ItemGroup> <PackageReference Include="Microsoft.AspNetCore.SignalR.Client"...