Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jan 28, 2026

Backport of #123663 to release/10.0

/cc @tarekgh @dmitry-kandiner

Customer Impact

  • Customer reported
  • Found internally

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 a System.InvalidOperationException, even though the binding is expected to succeed. The issue #123422 shows the customer report and more details.

Regression

  • Yes
  • No

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.

Dmitry Kandiner 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>
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-configuration
See info in area-owners.md if you want to be subscribed.

@tarekgh tarekgh added the source-generator Indicates an issue with a source generator feature label Jan 28, 2026
@tarekgh tarekgh added this to the 10.0.4 milestone Jan 28, 2026
@tarekgh tarekgh added the Servicing-consider Issue for next servicing release review label Jan 28, 2026
@tarekgh
Copy link
Member

tarekgh commented Jan 28, 2026

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.

The change looks minimal and addresses the reported regression. As before these special cases make me worry if we have inconsistent behavior around collection types.

Copy link
Member

@artl93 artl93 left a comment

Choose a reason for hiding this comment

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

Customer reported regression in 10. Narrow fix. Completed variant analysis. Approved.

@dmitry-kandiner
Copy link
Contributor

Is there any chance for adding this fix to 10.0.x milestone?

@tarekgh
Copy link
Member

tarekgh commented Jan 28, 2026

Is there any chance for adding this fix to 10.0.x milestone?

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.

@tarekgh tarekgh added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 28, 2026
@tarekgh
Copy link
Member

tarekgh commented Jan 28, 2026

Approved offline by email.

@tarekgh
Copy link
Member

tarekgh commented Jan 28, 2026

/ba-g the native AOT arm failing tests are known and unrelated. The infrastructure team is already following up.

@tarekgh tarekgh merged commit 42440b5 into release/10.0 Jan 28, 2026
97 of 106 checks passed
@jkotas jkotas deleted the backport/pr-123663-to-release/10.0 branch February 2, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Configuration Servicing-approved Approved for servicing release source-generator Indicates an issue with a source generator feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants