Using the ConfigurationManager
code/annotation configuration, I can define a rich, typed model for my app.config structure.
Is there a way (or tool or special incantation) to generate the corresponding XSD from this code-based model?
Having an XSD-schema makes it awesome to edit configuration files! (never thought I'd say that :)
So far, I found the lovely-looking Configuration Section Designer VS plugin and it generates XSD in addition to code!
But this is a designer-only solution and lacks a bit of flexibility (plus I'm afraid a designer-based solution is harder to scale).
I ended up giving Configuration Section Designer a more serious chance and I'm loving it! As it turns out, it's plenty flexible for my purpose. Here's shot of a part of my configuration definition:
Pros:
<section><item/><item/><section>
instead of <section><items><item/><item/></items><section>
I'm sure there are other things that I forgot about.
A few drawbacks:
But these are minor nuissances.
Overall, I got the job done quickly and easily. Thumbs up!