Skip to content

[Trimming] Enable trimming and AOT analyzers#21505

Merged
rmarinho merged 5 commits intodotnet:net9.0from
simonrozsival:enable-analyzers
Apr 15, 2024
Merged

[Trimming] Enable trimming and AOT analyzers#21505
rmarinho merged 5 commits intodotnet:net9.0from
simonrozsival:enable-analyzers

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

Description of Change

This PR enables trimming, AOT, and single file analyzers to assemblies where it doesn't require any changes. For Essentials.csproj and Compatibility.csproj I changed IsTrimmable to IsAotCompatible.

The only projects that don't have the analyzers enabled yet are:

  • Controls.Core.csproj - will need addressing a few issues
  • Controls.Xaml.csproj - will need addressing a few issues

I'm also skipping adding analyzers to:

  • Test projects
  • Compatibility projects
  • ControlGallery projects
  • *.Design projects (net472)
  • Templates
  • netstandard2.0 projects

Issues Fixed

Contributes to #18658

@simonrozsival simonrozsival marked this pull request as ready for review April 8, 2024 12:04
@simonrozsival simonrozsival requested review from a team as code owners April 8, 2024 12:04
@jonathanpeppers
Copy link
Copy Markdown
Member

@Eilon or someone in @dotnet/dotnet-maui-blazor-eng care to review?

This ignores a trimmer warning in WinForms/WPF BlazorWebView, but we filed an issue for the future at:

@Eilon
Copy link
Copy Markdown
Contributor

Eilon commented Apr 15, 2024

@Eilon or someone in @dotnet/dotnet-maui-blazor-eng care to review?

This ignores a trimmer warning in WinForms/WPF BlazorWebView, but we filed an issue for the future at:

I'm reviewing. If we take the change in #21797, does this PR need to change at all? (I think the change in #21797 is good, but I want to test locally first)

@jonathanpeppers
Copy link
Copy Markdown
Member

This PR doesn't need to change if #21797 goes in.

The warning suppressed here is around Assembly.Location that returns null in self-contained apps. But the code already does a null check.

@rmarinho rmarinho merged commit 59e0096 into dotnet:net9.0 Apr 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants