Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a way to prevent the loss of comments in my web.config if I use Visual Studio's settings editor?
    primarykey
    data
    text
    <p>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.</p> <p>Here's a (pretty vague) example extract to illustrate the bit I mean:</p> <pre><code> &lt;applicationSettings&gt; &lt;Animals.My.MySettings&gt; &lt;!-- Specify the type of animal this website is dedicated to... --&gt; &lt;setting name="AnimalType" serializeAs="String"&gt; &lt;value&gt;Monkey&lt;/value&gt; &lt;/setting&gt; &lt;/Animals.My.MySettings&gt; &lt;/applicationSettings&gt; </code></pre> <p>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.</p> <p>So far, I've come up with the following work-arounds:</p> <ol> <li><p>I could choose to <em>never</em> 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...</p></li> <li><p>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 <strong>and</strong> I have to remember to switch the config files on release... Too much to remember; too much could go wrong).</p></li> <li><p>Adding comments above the opening tag seems to be OK, so I could just have all my comments at the top.</p></li> </ol> <p>My question is: What's the best way to work around this problem? What do you recommend?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload