Open
Description
I'm using Microsoft.Extensions.Configuration.Ini
v:9.0.2 and I get a FormatException
every time I open the .ini file. For example I have this ini:
...
[UART]
Use = 1
Baudrate = 115200
COM = 31
COM = 25
...
And I build it into a configuration object:
IConfiguration config = new ConfigurationBuilder()
.AddIniFile(filePath)
.Build()
Then we get:
System.IO.InvalidDataException: 'Failed to load configuration from file 'filePath'.'
Inner Exception
FormatException: A duplicate key 'UART:COM' was found.
I want IConfigurationBuilder
to overwrite the value itself. The last written value will be the value that will get to IConfigurationBuilder
. If we consider the same example, the final COM
value will be 25