How to create a Blazor server-side application in a command-line interface (CLI).

Platform: Blazor| Category : Getting started, General

Follow these steps to create a Blazor Server application using a command-line interface (CLI). 

Create a Blazor Server App in CLI 

Open a command prompt where you want your project to be located and run the following command. 

.NET CLI 

dotnet new blazorserver -o BlazorServerApp 

Navigate to Blazor Server App 

Run the cd BlazorServerApp command to navigate to the BlazorServerApp folder. 

Run the apllication. 

The dotnet run command runs the application. See the following output in the default browser. 

Note: If you have installed multiple SDK versions and need a specific framework version (e.g., .net7.0) project, then add the -f or –framework flag to the dotnet new blazorserver command. 

.NET CLI 

dotnet new blazorserver -o BlazorServerApp –framework net6.0 

Refer to this documentation for more details. 

View Sample in GitHub 

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.