In this tutorial, we will discuss the Blazor WebAssembly Standalone App template provided by Microsoft and compare it to the Blazor WebAssembly App Empty template. Additionally, we will explore project template settings, including authentication types, HTTPS configuration, and other essential options.
The purpose of this tutorial is not to clear up all confusion regarding the many project templates for Blazor WebAssembly. Instead, we aim to help learners understand the Blazor WebAssembly Standalone App template and its settings. Many beginners feel overwhelmed by the numerous project settings, unsure of their functions and the consequences of selecting or unselecting them. This tutorial will guide you through these settings to help you make informed decisions when creating a new Blazor WebAssembly project.
Both are project templates for creating a Blazor WebAssembly project. Starting from .NET 8 onward, you should choose the Blazor WebAssembly Standalone App instead of the Blazor WebAssembly App Empty.
Projects created using the Blazor WebAssembly App Empty template can still be upgraded to the latest .NET version, but this requires some additional steps.
Once you have selected the Blazor WebAssembly Standalone App template, Visual Studio will ask for several settings. These settings are not permanent - everything can be modified later by manually adding or changing code.
Program.cs
to redirect HTTP to HTTPS. We recommend keeping this checked.service-worker.js
and other related files. We recommend keeping this checked.namespace
and class
declarations. We recommend keeping this unchecked.