Repository navigation
Honor overridden virtual property metadata in configuration binder - #135672
Merged
rosebyte merged 4 commits intoOct 30, 2026
Merged
Conversation
Both the reflection binder and the source generator selected the base-most declaration of an overridden virtual property, discarding any [ConfigurationKeyName]/[ConfigurationIgnore] attribute applied only to the override. Combined with the reflection binder also (in some cases) separately processing the base declaration, a renamed override of a getter-only collection property could be bound twice, once under the original name and once under the renamed one. Both binders now select metadata (name/ignore) from the most-derived declaration in the override chain, falling back to a less-derived declaration only to resolve an accessor the override doesn't re-declare (e.g. a get-only override of a read-write virtual property), since invoking that accessor still dispatches virtually to the actual override at run time.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-extensions-configuration |
vladimir-aubrecht
marked this pull request as ready for review
October 13, 2026 11:45
This was referenced Oct 13, 2026
Closed
This was referenced Oct 14, 2026
rosebyte
requested changes
Oct 19, 2026
Resolve effective accessors and inherited metadata across partial property overrides, ignore unsupported indexers, and preserve PropertyInfo invocation paths to avoid argument-array allocations. Add reflection and source-generator regression coverage for the reviewed edge cases.
rosebyte
reviewed
Oct 20, 2026
Resolve effective accessors and inherited property metadata once during property discovery, then reuse sparse cached data throughout binding. Use targeted non-indexer property lookups to avoid repeated hierarchy-wide property array allocations.
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.
Summary
ConfigurationKeyNameandConfigurationIgnoremetadata from the most-derived declaration of an overridden virtual property.This correctness fix is split from #134424 so that override metadata handling can be reviewed independently from property-level
TypeConverterAttributesupport.Testing
Microsoft.Extensions.Configuration.Binder.Tests: 364 passedMicrosoft.Extensions.Configuration.Binder.SourceGeneration.Tests: 436 passed, 28 skippedNote
This pull request description was generated with assistance from GitHub Copilot.