Skip to content

dotnet publish default build configuration should be Release instead of Debug since .NET 8 #45845

@timpaulus-fsw

Description

@timpaulus-fsw

Type of issue

Outdated article

Description

The following line seems wrong to me since .NET 8:

The default BUILD-CONFIGURATION mode is Debug unless changed with the -c parameter.

This was changed in .NET 8, see the 'dotnet publish' uses Release configuration Breaking Change:

The dotnet publish command now uses the Release configuration instead of the Debug configuration by default if the target framework is .NET 8 or a later version.

See also the current documentation for the -c|--configuration <CONFIGURATION> option of dotnet publish:

Defines the build configuration. If you're developing with the .NET 8 SDK or a later version, the command uses the Release configuration by default for projects whose TargetFramework is set to net8.0 or a later version

Page URL

https://learn.microsoft.com/en-us/dotnet/core/deploying/deploy-with-cli#framework-dependent-executable

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/deploying/deploy-with-cli.md

Document Version Independent Id

044ba93c-9ad9-80c7-dc5c-27a80c9bd921

Platform Id

4c19cbcb-f9e6-5957-a1cf-deb96f09bdf2

Article author

@adegeo

Metadata

  • ID: 8ee36626-0fc2-20d8-81c5-a3cd212244b2
  • PlatformId: 4c19cbcb-f9e6-5957-a1cf-deb96f09bdf2
  • Service: dotnet-fundamentals

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions