During/after the development of a .NET Core project, we deploy it to the desired environment, such as test, staging, pre-prod, or prod.
.NET Core applications can be deployed to an environment using the following options:
- Optimization options
- Debug
- Release
- Build options
- Framework dependent
- Self-contained
There are two different build modes in .NET: Debug and Release.
The .NET Core compiler can do a lot of optimization if it goes for the Release mode. The Debug mode includes a lot of extra code in the compiled assembly to make it easier for a developer when debugging the application. The Release mode is a stripped and extra optimized version of Debug mode.
Generally, we use the Debug mode for debugging the project, and the Release mode for the final build for the production environment.
Let's create a sample project by executing the following command in the project's folder and examining the differences between these options:
dotnet new web