[Inflight/Candidate] Fix the Build errors when build src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj in release. - #36607
Merged
kubaflo merged 2 commits intoJul 20, 2026
Conversation
KarthikRajaKalaimani
had a problem deploying
to
copilot-pat-pool
July 16, 2026 06:20 — with
GitHub Actions
Failure
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Hey there @@KarthikRajaKalaimani! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This was referenced Jul 16, 2026
Contributor
|
/azp run maui-pr-uitests , maui-pr-devicetests |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
sheiksyedm
marked this pull request as ready for review
July 20, 2026 14:30
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details:
Build error occurs when build src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj in release.
Root Cause:
Release uses the XamlC inflator by default, which fully compiles bindings at build time. PR #35798's new TryGetRelativeSourceAncestorTypeReference logic in SetPropertiesVisitor.cs now treats AncestorType={x:Type ContentPage} as the effective source type for validation, and since SelectedItem / NavigateCommand only exist on BasePage (not ContentPage), it raises XC0045 and fails the build.
Description of Change:
The fix was applied at the source level in src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs . A new tSourceRefIsAncestorTypeInferred flag now tracks whether the binding's source type came purely from AncestorType inference rather than an explicit x:DataType on the binding node. When property-path resolution against that inferred type fails, and this flag is set, the error is suppressed and the method returns false to gracefully skip TypedBinding compilation — falling back to the original reflection-based Binding , exactly as XamlC always did before PR #35798 for these ambiguous cases. This also mirrors the SourceGen inflator's existing equivalent fallback in KnownMarkups.ProvideValueForBindingExtension . Bindings with an explicit x:DataType , or where the property genuinely doesn't exist anywhere in the runtime ancestor chain, are unaffected and continue to raise XC0045 as intended, preserving PR #35798's original AOT-safety fix.
Tested the behavior in the following platforms:
Reference:
N/A
Issues Fixed:
Fixes #36563