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
- Solution file and folder:
Chapter11
- 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
, treat warnings as errors, and globally and statically import theSystem.Console
class, as shown in the following markup:<ItemGroup> <PackageReference Include="Microsoft.AspNetCore...