Comparing Blazor project templates
One way to understand the choice between the Blazor Server and Blazor WebAssembly hosting models is to review the differences in their default project templates.
ASP.NET Core 7 introduces some “empty” project templates for Blazor. They are like the project templates that we will review in this chapter except without the demonstration components, Counter and Fetch data from the weather service, and without Bootstrap. They do still retain a basic home component, so they are not strictly empty. In Visual Studio 2022, the project templates are named Blazor Server App Empty and Blazor WebAssembly App Empty. At the command-line, they are named blazorserver-empty
and blazorwasm-empty
.
Reviewing the Blazor Server project template
Let us look at the default template for a Blazor Server project. Mostly you will see that it is the same as an ASP.NET Core Razor Pages template, with a few key additions:
- Use your...