Exploring the WebAssembly template
The WebAssembly template looks slightly different from the templates we looked at in Chapter 2, Creating Your First Blazor App. In the Blazor Web App template, our entry point is the app.razor
file. It contains the HTML tags we need to get started. The WebAssembly template had an Index.html
file. Let’s create a project so we can take a look:
- Create a new project and use the
Blazor WebAssembly Standalone App
template. - Name the project
BlazorWebAssembly
. - Leave the defaults as is and press Create.
First, in the wwwroot
folder, we have a Index.html
that has all the CSS, JavaScript, and so on. This is the same content as the App.razor
file in the Blazor Web App template. We have an app.razor
file in the WebAssembly project as well, but that contains the same things as the Routes.razor
file. So it is a bit confusing if we work with both templates.
Let’s take a look at each file but only focus on the things...