What’s the difference between the dotnet build -c Release
and dotnet publish
commands?
When running dotnet build -c Release
and dotnet publish
the outputs are placed in
/bin/Release/net8.0/
and /bin/Release/net8.0/publish
, respectively. Inspecting the contents, it looks identical.
dotnet build
defaults to Debug
configuration, while dotnet publish
defaults to Release
.
References:
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish