Hosting a Blazor Application
Explore the process of hosting a Blazor WebAssembly application within a SignalR server using ASP.NET Core. Understand how to configure project references, install required packages, add views and navigation, and ensure proper middleware access to serve the Blazor client effectively.
Overview
Our current Blazor application is set up as a standalone self-hosted app, so we need to make some changes to be able to host it in another application.
Step 1: Remove the line
The first change that we will do is to open the Program.cs file inside the BlazorClient project and remove the following line:
builder.RootComponents.Add<App>("#app");
Step 2: Add a reference of the BlazorClient project
We'll need to add a BlazorClient project reference to the SignalRServer project. You have to add the following snippet to ...