-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Binding with IDictionary<,> implementer types #77582
Fix Binding with IDictionary<,> implementer types #77582
Conversation
Tagging subscribers to this area: @dotnet/area-extensions-configuration Issue DetailsFixes #77246 In .NET 7.0 we have done some refactoring work in the configuration binding code #68133. The refactored code work fine when binding to
|
CC @SteveDunn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - sorry I didn't address the issue myself but I'm a bit busy in my day job right now.
src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs
Outdated
Show resolved
Hide resolved
...aries/Microsoft.Extensions.Configuration.Binder/tests/ConfigurationCollectionBindingTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs
Show resolved
Hide resolved
/backport to release/7.0 |
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3430573766 |
Fixes #77246
In .NET 7.0 we have done some refactoring work in the configuration binding code #68133. The refactored code work fine when binding to
IDictionary<,>
interface orDictionary<,>
based class but it broke the case when using a type which implementingIDictionary<,>
interface. The new code was always creatingDictionary<,>
type and then getting the setter of theItem
property from that type. But the object used in the binding is not of typeDictionary<,>
at all and the property setter fails because it is used with wrong type.