Skip to Content
C# 8 and .NET Core 3 Projects Using Azure - Second Edition
book

C# 8 and .NET Core 3 Projects Using Azure - Second Edition

by Paul Michaels, Dirk Strauss, Jas Rademeyer
December 2019
Intermediate to advanced
528 pages
11h 19m
English
Packt Publishing
Content preview from C# 8 and .NET Core 3 Projects Using Azure - Second Edition

Configuration changes

In the Startup.cs file, we need to add the SignalR Service to the container, as well as configure the HTTP request pipeline. Let's get started:

  1. In the ConfigureServices method, add the following code:
services.AddSignalR().AddAzureSignalR();
  1. In the Configure method, add the following code:
app.UseDefaultFiles();app.UseStaticFiles();
app.UseAzureSignalR(r =>
{
    r.MapHub<Chat>("/chat");
});
Note that we have added app.UseStaticFiles() to the Configure method. Static files are assets that an ASP.NET Core app serves directly to clients. Examples of static files include HTML, CSS, JavaScript, and images. The call to app.UseDefaultFiles() (which must be called prior to app.UseStaticFiles()) tells the middleware to search ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Enterprise Application Development with C# 9 and .NET 5

Enterprise Application Development with C# 9 and .NET 5

Ravindra Akella, Rishabh Verma, Arun Kumar Tamirisa, Suneel Kumar Kunani, Bhupesh Guptha Muthiyalu
ASP.NET Core 2 and Angular 5

ASP.NET Core 2 and Angular 5

Valerio De Sanctis, Jürgen Gutsch
ASP.NET Core 5 for Beginners

ASP.NET Core 5 for Beginners

Andreas Helland, Vincent Maverick Durano, Jeffrey Chilberto, Ed Price

Publisher Resources

ISBN: 9781789612080Supplemental Content