Building Blazor components
With ASP.NET Core 7, Blazor introduces new project templates for starting from an empty project. They provide the minimum to run, without any example components. These include the old Counter
component that has a button that increments a label that starts at one when clicked, or the FetchData
component that calls a weather service and shows a table with five rows of random temperatures.
First, we will create a Blazor WebAssembly project that we will then add components to:
- Use your preferred code editor to create a new solution/workspace named
Chapter16
. - Add a console app project, as defined in the following list:
- Project template: Blazor WebAssembly App Empty/
blazorwasm-empty
- Workspace/solution file and folder:
Chapter16
- Project file and folder:
Northwind.BlazorWasm
- Configure for HTTPS: Selected
- ASP.NET Core Hosted: Selected or use the
--hosted
switch - Progressive Web App:...
- Project template: Blazor WebAssembly App Empty/