In your command prompt, run the following command to create your app:
In your terminal, run the following command to create your app:
dotnet new blazorserver -o BlazorApp --no-https
Then, navigate to the new directory created by the previous command:
dotnet new blazorservercommand creates a new Blazor Server app for you.
-oparameter creates a directory named
BlazorAppwhere your app is stored and populates it with the required files.
--no-httpsflag specifies not to enable HTTPS.
cd BlazorAppchanges your current directory to the one just created for the new app.
Several files were created in the
BlazorApp directory, to give you a simple Blazor app that is ready to run.
Program.csis the entry point for the app that starts the server.
Startup.csis where you configure the app services and middleware.
App.razoris the root component for the app.
BlazorApp/Pagesdirectory contains some example web pages for the app.
BlazorApp.csprojdefines the app project and its dependencies.
If you receive a message similar to
Template "Blazor Server App" could not be created. Access to the path 'C:\Windows\System32\BlazorApp' is denied, change your current directory to one where you have permissions to create a new folder and try to run the command again. If you can't resolve the issue, use the
I ran into an issue button to get help fixing the problem.