Skip to content

Don't suppress trim analysis warnings when linking all assemblies #11246

@sbomer

Description

@sbomer

dotnet/sdk#16865 adds a property (available in preview4) TrimmerDefaultAction which can be set to link to enable "LinkAll" behavior. Consider not suppressing trim analysis warnings in this case to warn users about possible issues.

This can be done by setting the following in some targets that are imported after the project file but before the .NET illink targets (so that it takes into account any user-set value for TrimmerDefaultAction):

<SuppressTrimAnalysisWarnings Condition="'$(SuppressTrimAnalysisWarnings)' == '' And '$(TrimmerDefaultAction)' != 'link'">true</SuppressTrimAnalysisWarnings> 

and removing the unconditional setting from here:
https://github.com/xamarin/xamarin-macios/blob/5e18eae0cabeef04e10f3c80d5d68a9ec3e7dab4/dotnet/targets/Xamarin.Shared.Sdk.props#L12

@jonathanpeppers @marek-safar

See also #10405.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnetAn issue or pull request related to .NET (6)enhancementThe issue or pull request is an enhancementgood first issueThis is a good first issue for someone to start working with our code

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions