1

I need to create a custom block in web config as follows:

<MySettings>
    <add name="name1" value="value1" />
    <add name="name2" value="value2" />
    <add name="name3" value="value3" />
    ...
</MySettings>

Ad i understand, i should derive my custom settings class from ConfigurationSection, but i don't know how to make it scalable. I need to add a lot of items to that block, and use it as a key-value pair.

I also understand that it's possible to do it all through section, but i need to create a custom one, since key and value fields might not be enough for me and i will need to extend them.

Thank you very much for assistance!

0100110010101
  • 6,469
  • 5
  • 33
  • 38

1 Answers1

2

To create a structure of add/clear/remove child elements the type matching the MySettings element needs to derive from ConfigurationElementCollection.

Richard
  • 106,783
  • 21
  • 203
  • 265