Skip to content

dotnet build compile

Context: dotnet build compiles the project. By default, it creates a Debug build. Use -c Release for optimized build.

dotnet build compiles the project and its dependencies into a set of binaries.

Terminal window
# Build the current project
dotnet build
# Build with specific configuration
dotnet build -c Release
# Build a specific project
dotnet build path/to/MyProject.csproj
  • Debug build: bin/Debug/ (includes debug symbols)
  • Release build: bin/Release/ (optimized)
OptionDescription
-c, --configurationDebug or Release
-o, --outputOutput directory
--no-restoreDon’t restore packages
-v, --verbosityBuild output detail level
Terminal window
# Verbose build output
dotnet build -v detailed