Skip to content

Do we want to keep PublishTrimmed a publishing option? #2085

@MichalStrehovsky

Description

@MichalStrehovsky

PublishTrimmed is currently a checkbox in the VS publish dialog. We also have docs and blog articles suggesting people publish by adding /p:PublishTrimmed=true parameter to their dotnet command line.

We set several defaults based on PublishTrimmed in the SDK: https://github.com/dotnet/sdk/blob/9ed756ecfe082b738af11a76cabb74742102a0a7/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets#L31-L44

The problem with that is that if people specify trimming as part of publish, they'll get different behavior after publishing from the behavior they would get with F5 debug or dotnet run due to feature switches being enabled when publishing, but not when building.

We need to shift the recommendation from "specify trimming as part of publish" to "specify trimming in the csproj".

VS UI should also change.

Cc @vitek-karas @sbomer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions