Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

.NET 7 RC 1 how to show a warning from a linker step? #2982

Closed

Description

@jonathanpeppers

We were originally doing this:

https://github.com/xamarin/xamarin-android/blob/4873dfafa6e72a5d898307df759c22da494fc692/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixAbstractMethodsStep.cs#L59

And I believe this change made our warning disappear in projects by default: 82c6dc6

You can probably enable this warning with $(SuppressTrimAnalysisWarnings) set to false, but is there a way to make a warning always appear? Maybe we lost a way to do that?

Activity

  1. sbomer commented on Aug 18, 2022

    @sbomer
    Member

    The assumption behind that change was that we could treat all warnings produced by the linker as belonging to the "trim analysis" category - but maybe we need a different concept to handle this if the Xamarin warnings should be shown even with SuppressTrimAnalysisWarnings. Do you think users would expect that warning to show up if they specified <SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>?

    In the meantime, if you need a workaround, you could try the following:

    • when SuppressTrimAnalysisWarnings is true:
      • set ILLinkWarningLevel to 4
        this will still prevent the built-in warnings from showing since they all have a version 5
    • where you produce the custom warnings, pass in (WarnVersion) 4
  2. added this to the .NET 7.0 milestone on Aug 23, 2022
  3. self-assigned this
    on Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    No status

Relationships

None yet

Development

No branches or pull requests

Issue actions