[release/10.0] Fixed codegen for IEnumerable<T> binding (#123422)#123720
Merged
tarekgh merged 2 commits intorelease/10.0from Jan 28, 2026
Merged
[release/10.0] Fixed codegen for IEnumerable<T> binding (#123422)#123720tarekgh merged 2 commits intorelease/10.0from
tarekgh merged 2 commits intorelease/10.0from
Conversation
added 2 commits
January 28, 2026 16:57
Binding of an IEnumerable<T> in a nested positional record resulted in throwing of an InvalidOperationException from source generated code. The condition for emitting the code throwing the exception only worked with Arrays, and this fix applies the same logic for IEnumerable<T> as well. Fix #123422 Signed-off-by: Dmitry Kandiner <dkandiner@growings.com>
Signed-off-by: Dmitry Kandiner <dkandiner@growings.com>
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-configuration |
Member
ericstj
approved these changes
Jan 28, 2026
...crosoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.TestClasses.cs
Show resolved
Hide resolved
artl93
approved these changes
Jan 28, 2026
Member
artl93
left a comment
There was a problem hiding this comment.
Customer reported regression in 10. Narrow fix. Completed variant analysis. Approved.
Contributor
|
Is there any chance for adding this fix to 10.0.x milestone? |
Member
What do you mean by that? This PR is about that. It is to merge the change to the release/10.0 branch for servicing. |
Member
|
Approved offline by email. |
Member
|
/ba-g the native AOT arm failing tests are known and unrelated. The infrastructure team is already following up. |
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.
Backport of #123663 to release/10.0
/cc @tarekgh @dmitry-kandiner
Customer Impact
Using configuration source generator, when a user binds configuration to a class or record with a primary constructor, and one of the constructor parameters is exact of type
IEnumerable<T>, the binding throws aSystem.InvalidOperationException, even though the binding is expected to succeed. The issue #123422 shows the customer report and more details.Regression
This is a regression in .NET 10.0.1. A previous servicing fix addressed several crashes, but one case was missed. That omission surfaced as this regression. The change that introduced the regression is #121325.
Testing
Manually verified the failing scenario and confirmed the fix resolves the issue. Added a regression test covering the previously failing case and ran the full test suite successfully. Reviewed related code paths to ensure no additional cases were missed.
Risk
Low, the change is targeting the specific case with specific type. The fix is localized to the failing scenario.