Search code examples
c#.netasp.netc#-3.0scsf

the best way to store tree like information in app.config


What would be the best way to store a tree like the one below in app.config and how would I deserialize this information from it?

Tree
|-node1-
|       |-name - value
|       |-name - value
|       | ......
|-node2-
|       |-name - value
|       |-name - value
|       | ......
|-node3-
|       |-name - value
|       |-name - value
|       | ......

I can convert that tree to xml if that helps.

Thanks for any assistance in advance.


Solution

  • Use a custom configuration section. For one way to do this, see Configuration Section Designer. You can do it manually, but you might like to play with CSD and see the code it generates.