Commit 42440b5
Backport of #123663 to release/10.0
/cc @tarekgh @dmitry-kandiner
## Customer Impact
- [x] 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
- [x] 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.
---------
Signed-off-by: Dmitry Kandiner <dkandiner@growings.com>
Co-authored-by: Dmitry Kandiner <dkandiner@growings.com>
1 parent e08f350 commit 42440b5
3 files changed
Lines changed: 33 additions & 2 deletions
File tree
- src/libraries/Microsoft.Extensions.Configuration.Binder
- gen/Emitter
- tests/Common
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
417 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
418 | 419 | | |
419 | 420 | | |
420 | 421 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
1187 | 1193 | | |
1188 | 1194 | | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3060 | 3060 | | |
3061 | 3061 | | |
3062 | 3062 | | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
3063 | 3087 | | |
3064 | 3088 | | |
0 commit comments