Skip to content
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 Configuration to throw with ErrorOnUnknownConfiguration option #110209

Merged

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Nov 27, 2024

Fixes #110147

This change addresses a regression introduced in Microsoft.Extensions.Configuration.Binder version 9.0.0. The issue occurs when binding a configuration with ErrorOnUnknownConfiguration set to true, where an InvalidOperationException should be thrown. The regression specifically affects scenarios involving collections, where binding collection values to invalid configuration values does not behave as expected.

The original change caused the regression is #97777

The change is ensuring back to the .NET 8.0 behavior, but we should look at fixing the source generator in general with ErrorOnUnknownConfiguration.

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small style comment.

@tarekgh tarekgh merged commit 73877b4 into dotnet:main Dec 4, 2024
78 of 83 checks passed
eduardo-vp pushed a commit to eduardo-vp/runtime that referenced this pull request Dec 5, 2024
…otnet#110209)

* Fix Configuration to throw with ErrorOnUnknownConfiguration option

* Fix the fired Debug.Assert

* address the feedback
mikelle-rogers pushed a commit to mikelle-rogers/runtime that referenced this pull request Dec 10, 2024
…otnet#110209)

* Fix Configuration to throw with ErrorOnUnknownConfiguration option

* Fix the fired Debug.Assert

* address the feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration binding does not throw when it should
2 participants