Project Template

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.

  • Blazor WebAssembly Standalone App vs Blazor WebAssembly App Empty.
  • Template settings.

Blazor WebAssembly Standalone App vs Blazor WebAssembly App Empty

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.


Template settings

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.

  • Framework: Set to the latest version.
  • Authentication type: Visual Studio will generate some default code. Choosing None does not mean your app will remain unauthenticated forever - you can add authentication later. We recommend selecting None.
  • Configure for HTTPS: Visual Studio will add code in Program.cs to redirect HTTP to HTTPS. We recommend keeping this checked.
  • Progressive Web Application: Allows your website to run offline. Visual Studio will generate service-worker.js and other related files. We recommend keeping this checked.
  • Include sample pages: Visual Studio will generate some sample code for you.
  • Do not use top-level statements: When checked, Visual Studio will generate old-style code with namespace and class declarations. We recommend keeping this unchecked.
  • Enlist in .NET Aspire orchestration: Visual Studio will generate a .NET Aspire project and add the Blazor WebAssembly app to it. For simplicity, we recommend keeping this unchecked.
BLAZOR SCHOOL
Designed and built with care by our dedicated team, with contributions from a supportive community. We strive to provide the best learning experience for our users.
Docs licensed CC-BY-SA-4.0
Copyright © 2021-2025 Blazor School
An unhandled error has occurred. Reload 🗙