[Breaking change]: Repeated XML Elements Now Have Index Key in Microsoft.Extensions.Configuration.Xml #30660
Closed
1 of 2 tasks
Labels
binary incompatible
Existing binaries may encounter a breaking change in behavior.
breaking-change
Indicates a .NET Core breaking change
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
Pri1
High priority, do before Pri2 and Pri3
Description
When Microsoft.Extensions.Configuration.Xml is used to read an XML document that has repeated XML elements without a
Name
attribute, for example:-or-
The Configuration entries created with these repeated elements will now have an index appended to their configuration path.
Version
6.0.0
Version
Other (please put exact version in description textbox)
Previous behavior
The Configurations created from the above XML files were:
and
respectively.
New behavior
The Configurations created from the above XML files are now:
and
respectively.
Type of breaking change
Reason for change
This change was introduced to fully support repeated XML elements without a
Name
attribute. The previous behavior only allowed for repeated elements to set unique values (attributes or sub-elements). If repeated XML elements had the same attribute, an exception would be thrown.Recommended action
0
,1
,2
, etc. indices in the IConfiguration keys.becomes
Feature area
Extensions
Affected APIs
https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.xmlconfigurationextensions
https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.xml.xmlstreamconfigurationprovider
https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.xml.xmlconfigurationsource
The text was updated successfully, but these errors were encountered: