Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on TrimMode=copyused #3042

Closed
wants to merge 3 commits into from
Closed

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Sep 19, 2022

Fixes #3039

Warns if using deprecated TrimMode=copyused in net7.0. Also sets the default action to copy as a fallback when not using TrimMode full or partial in 7.0.

@sbomer sbomer requested a review from vitek-karas September 19, 2022 18:02
Comment on lines 208 to 209
<Warning Condition="'$(TrimMode)' == 'copyused' And $([MSBuild]::VersionGreaterThan('$(TargetFrameworkVersion)', '6.0'))"
Text="TrimMode 'copyused' is deprecated in .NET 7. Use TrimMode 'full' or 'partial' instead." />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing which worries me about this is that it's basically impossible to suppress this warning. Which might break people's builds.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we agreed offline that any change here is pretty risky for .NET 7. I changed it to produce a warning and ignore unsupported values in .NET 8 only, with a warning. I also added _TrimMode as an escape hatch similar to _TrimmerDefaultAction.

@sbomer sbomer requested a review from vitek-karas September 21, 2022 16:55
@marek-safar
Copy link
Contributor

@sbomer should this PR be closed?

@sbomer sbomer closed this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CopyUsed with new TrimMode
3 participants