Getting ready

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 

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.