Creating a Blazor WebAssembly Project
In this article, we'll learn about Blazor WebAssembly and we'll see how to create a project using Visual Studio and dotnet CLI.
Starting with Visual Studio 16.6.3 and .NET core 3.1.301 you can create Blazor applications for both server and client/WebAssembly.
What's Blazor WebAssembly?
With Blazor WebAssembly, you can run the code the web browser as a SPA (Single Page Application).
Creating a New Blazor WebAssembly Project
You can use Visual Studio to create a new Blazor project by following these steps:
- First, create a new project and look for the Blazor App template
- You’ll be able to choose between creating a Blazor Server App or Blazor WebAssembly App
If you prefer the command-line interface, you can use the dotnet CLI to create your project.
Head over to a new command-line interface and run the following command:
$ dotnet new blazorwasm -o your-project-name
Next, navigate to your project's folder and run a local development server using the following commands:
$ cd your-project-name $ dotnet run
You can then open your web browser and visit your the application from the