[Trimming] Disable assembly scanning for types implementing IVisual#20417
Merged
rmarinho merged 3 commits intodotnet:net9.0from Feb 9, 2024
Merged
Conversation
60fcc52 to
7ee3a28
Compare
7ee3a28 to
d8865d3
Compare
PureWeen
previously approved these changes
Feb 8, 2024
ivanpovazan
reviewed
Feb 9, 2024
| buildProps.Add("PublishAotUsingRuntimePack=true"); // TODO: This parameter will become obsolete https://github.com/dotnet/runtime/issues/87060 | ||
| buildProps.Add("_IsPublishing=true"); // using dotnet build with -p:_IsPublishing=true enables targeting simulators | ||
| buildProps.Add($"RuntimeIdentifier={runtimeIdentifier}"); | ||
| buildProps.Add("IlcTreatWarningsAsErrors=false"); // TODO: Remove this once all warnings are fixed https://github.com/dotnet/maui/issues/19397 |
Member
There was a problem hiding this comment.
Thanks for fixing this!
I will create a separate PR for all IlcTreatWarningsAsErrors=false in net8.0 branch as a follow-up, as we might backport this feature to net8.0 on the dotnet/runtime side.
19 tasks
StephaneDelcroix
approved these changes
Feb 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
When an app uses visuals, we preform assembly scanning to find all types that implement
IVisual. This is not trimming-safe and it will likely not work with trimming/NativeAOT.Instead, I propose adding a new app builder APIUseVisual<TVisual>()to register any visual which is used in the app (alongside the default visuals). This API has been suggested in #4937.For backwards compatibility, I added a feature switch
MauiEnableIVisualAssemblyScanningwhich I propose to be disabled by default in .NET 9.Issues Fixed
Fixes #4937, contributes to #19397
/cc @eerhardt @PureWeen