I'm using the settings editor in Visual Studio 2010 to add/edit/remove my settings from the section of my .NET 4 web.config file.
Here's a (pretty vague) example extract to illustrate the bit I mean:
<applicationSettings>
<Animals.My.MySettings>
<!-- Specify the type of animal this website is dedicated to... -->
<setting name="AnimalType" serializeAs="String">
<value>Monkey</value>
</setting>
</Animals.My.MySettings>
</applicationSettings>
In the example above, the comment is useful for anyone manually editing the config file on-site (e.g. once the web application has been deployed to the customer site). However, if I use the VS settings editor, the comment is lost whenever I add/edit/remove a setting.
So far, I've come up with the following work-arounds:
I could choose to never use the VS settings editor, but I'd have to tell my team to avoid it too, and there's always the one time that someone forgets and we lose all our comments...
I could keep a separate copy of the web.config, with a bunch of comments in it. We then ship the application with the copy of the config file... (I don't like this idea, because it means I've got to remember to keep the second copy up-to-date and I have to remember to switch the config files on release... Too much to remember; too much could go wrong).
Adding comments above the opening tag seems to be OK, so I could just have all my comments at the top.
My question is: What's the best way to work around this problem? What do you recommend?