Skip to content

SDK reports a number of new errors when multi-targeting and enabling AOT/Trim analyzers #35528

Closed
@tannergooding

Description

@tannergooding

As per the title, the .NET 8 RC1 SDK is reporting a number of new errors when setting properties such as:

  • EnableAotAnalyzer
  • EnableSingleFileAnalyzer
  • EnableTrimAnalyzer
  • IsTrimmable

These errors surface if the properties are set to true and the TFM does not support the functionality.

This is unfortunate because it puts a responsibility on the end user to understand the inner complexities and limitations of the tooling and what TFMs they support in a multi-targeted project.

The SDK and tooling itself already knows this information and it would, in my opinion, be significantly better if the SDK simply did the right thing and ignored the property on TFMs where the analyzer don't work.

It might be desirable to still surface a warning so users are aware that netstandard2.0 won't be analyzed or trimmed, but I wholeheartedly believe that erroring out here is the wrong thing and that if a warning is surfaced, the user should be able to suppress it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions