Deploying your website is the process of compiling (building) your code and hosting the DLL file on a web server.
This section builds on the previous step in the Getting Started tutorial and shows you how to deploy your application.
A best practice is to run your website locally before you deploy it to another environment. To run your project locally, you need to install the .NET SDK on your computer.
run
command, it will build and run the project. Note that you need to open the cmd in the root project not the root solution.dotnet run
The website runs on ports 5000 and 5001 by default for Kestrel. To view the website, navigate to the http://localhost:5000 or https://localhost:5001.
publish
command.dotnet publish -c Release -o "YourFolder"
By default, publish
command uses the debug build configuration. For production ready, you need to specify the -c Release
to specify build by release configuration. The -o "YourFolder"
part is to specify the output folder, if you don't specify the output folder, you can see the published files at [project_folder]/bin/[configuration]/[framework]/publish/ folder by default.
In this tutorial, you have learned the foundation to explore the Blazor Server world in areas such as UX/UI development, mobile development, and server-side rendering, web assembly interacting, javascript interacting. You can go deeper by studying more of Blazor Server's features, engaging with the vibrant community, and exploring the robust ecosystem.
To explore Blazor Server's foundational concepts, see the guides in the Understanding Blazor Server section.