Clarify how configuration binder binds types - #55762
Open
svick wants to merge 1 commit into
Open
Conversation
svick
requested review from
mrek-msft and
rosebyte
and
a lite review from Copilot
August 27, 2026 15:44
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Binding section in configuration.md to replace an incomplete/inaccurate list with a clearer, more complete summary of how the configuration binder binds different target shapes and types (including a note about a source-generator limitation).
Changes:
- Replaces the prior high-level binder “approaches” list with a more concrete set of binding behaviors (scalar conversion, hierarchical binding, collection binding, section passthrough, and custom conversion).
- Adds an explicit note that
TypeConverter-based custom conversions aren’t supported by the source generator binder.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+78
to
+82
| - Use a single configuration value directly for a `string` or `object` target, or convert it to a common .NET type, such as a numeric type, an enumeration, or a nullable type. The binder converts a Base64-encoded string to a byte array. | ||
| - Bind hierarchical configuration to an object's properties or constructor parameters. | ||
| - Bind child configuration sections to arrays, collections, sets, and dictionaries. | ||
| - Use the matching configuration section directly when the target type is <xref:Microsoft.Extensions.Configuration.IConfigurationSection>. | ||
| - Convert a single configuration value to a custom type. The default binder uses a <xref:System.ComponentModel.TypeConverter> when the custom type defines one. The source generator binder doesn't support this. |
rosebyte
approved these changes
Aug 27, 2026
rosebyte
left a comment
Member
There was a problem hiding this comment.
Copilot has a good point with the ...s suffixes, otherwise LGTM.
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.
The old list was incomplete and inaccurate (especially for the source generator binder).
The new list should be accurate and complete, without going into too much detail (it's probably not useful to explicitly list the types supported by the source generator binder here).
Internal previews
Build report