maui icon indicating copy to clipboard operation
maui copied to clipboard

[XC] Avoid NativeAOT trim warnings for compiled bindings

Open simonrozsival opened this issue 1 year ago • 2 comments

Contributes to #25406

Description of Change

The BindingExtension class has an attribute that tells XamlC to include the XamlTypeResovler in the service provider when calling the ProvideValue method:

https://github.com/dotnet/maui/blob/70f1f76cf67966e5e86a5caa7ddb30f7236a0269/src/Controls/src/Xaml/MarkupExtensions/BindingExtension.cs#L9-L10

The XamlTypeResovler is 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 the BindingExtension (see the referenced issue for more details).

simonrozsival avatar Oct 19 '24 16:10 simonrozsival

/azp run

jonathanpeppers avatar Oct 21 '24 13:10 jonathanpeppers

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

azure-pipelines[bot] avatar Oct 21 '24 13:10 azure-pipelines[bot]

Closing in favor of #25420

simonrozsival avatar Oct 21 '24 14:10 simonrozsival