Creating the Demo Blazor WebAssembly Project

Learn how to create our project in Blazor WebAssembly using the Blazor WebAssembly project template.

The Demo project that we are creating is based on one of the many sample projects that are provided by the Blazor WebAssembly App project template. After we have used the template to create the project, we will examine the files in the sample project and update some of the files to demonstrate how to use Razor components. Finally, we will separate the code block of one of the components into a separate file to demonstrate how to use the code-behind technique to separate the markup from the code.

Creating the Demo project

Visual Studio comes with quite a few project templates. We are going to use the Blazor WebAssembly App project template to create our first Blazor WebAssembly project. Since this project template can be used to create many different types of Blazor projects, it is important to follow the instructions carefully:

  1. Open Visual Studio.

  2. Click the “Create a new project” button.

  3. In the “Search for templates (Alt+S)” textbox, enter “Blazor” and hit the “Enter” key.

    The following screenshot shows the Blazor WebAssembly App project template that we will be using:

Get hands-on with 1200+ tech skills courses.