[XC] Avoid NativeAOT trim warnings for compiled bindings - #25420
Merged
rmarinho merged 4 commits intoOct 21, 2024
Merged
Conversation
simonrozsival
requested review from
StephaneDelcroix
and removed request for
a team
October 21, 2024 14:25
jonathanpeppers
approved these changes
Oct 21, 2024
| /// </summary> | ||
| public bool ValidateOnly { get; set; } | ||
|
|
||
| internal bool GenerateFullILInValidateOnlyMode { get; set; } |
Member
There was a problem hiding this comment.
So, we shouldn't have a need to ever set this from MSBuild? Just unit tests?
rmarinho
approved these changes
Oct 21, 2024
rmarinho
deleted the
dev/srozsival/fix-compiled-binding-extension-ilc-warning
branch
October 21, 2024 18:44
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.
Contributes to #25406
Description of Change
The
BindingExtensionclass has an attribute that tells XamlC to include theXamlTypeResovlerin the service provider when calling theProvideValuemethod:maui/src/Controls/src/Xaml/MarkupExtensions/BindingExtension.cs
Lines 9 to 10 in 70f1f76
The
XamlTypeResovleris not trim and AOT compatible. Fortunately, it is NOT necessary when the binding is compiled. This PR adds a workaround that will prevent generating the faulty code in .NET 9. I think we should follow-up on this later in .NET 10 and properly compile theBindingExtension(see the referenced issue for more details).