title: Using App.config to set strongly-typed variables
body: <p>I'm a C# novice running .NET 3.5, and I'd like to store a bunch of application default values in App.config, as the settings may vary by server environment (e.g. development, staging, production).  What I want to do is similar to what's described in <a href="https://stackoverflow.com/questions/685259/getting-configuration-settings-from-web-config-app-config-using-class-library"><b>this StackOverflow article</b></a>, but I also want to be able to use non-string values (e.g. int, bool).  Something like this (name-values are just examples, btw):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
      &lt;applicationSettings&gt;
          &lt;MyApp&gt;
              &lt;setting name="InitText" serializeAs="String"&gt;
                  &lt;value&gt;Hello&lt;/value&gt;
              &lt;/setting&gt;
              &lt;setting name="StartAt" serializeAs="Integer"&gt;
                  &lt;value&gt;5&lt;/value&gt;
              &lt;/setting&gt;
              &lt;setting name="IsWeekend" serializeAs="Boolean"&gt;
                  &lt;value&gt;True&lt;/value&gt;
              &lt;/setting&gt;
          &lt;/MyApp&gt;
      &lt;/applicationSettings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Could somebody provide an example of how to do this, and how to retrieve the values via C#?  I've seen a lot of examples that require using  and , but I'm not sure if I need those elements, and if so, how to create them.</p>