Skip to content
Discussion options

You must be logged in to vote

Binding a configuration to a type supports (public) properties but unfortunately not fields. And value tuples have fields but no properties. Hence why the configuration binder cannot populate the value tuple (Child1 Child1, Child2 Child2), because the tuple members Child1 and Child2 are fields. :-(

Therefore, given the current feature set of Microsoft.Extensions.Configuration.Binder, the probably simplest solution to your problem is to replace the value tuple types involved in configuration binding with records/classes/structs featuring public properties.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by joegoldman2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants