title: Parsing boolean from configuration section in web.config
body: <p>I have a custom configuration section in my web.config.</p>
  
  <p>One of my classes is grabbing from this:</p>
  
  <pre><code>&lt;myConfigSection LabelVisible="" TitleVisible="true"/&gt;
  </code></pre>
  
  <p>I have things working for parsing if I have true or false, however if the attribute is blank I am getting errors. When the config section tries to map the class to the configuration section I get an error of "not a valid value for bool" on the 'LabelVisible' part.</p>
  
  <p>How can I parse "" as false in my myConfigSection class?</p>
  
  <p>I have tried this:</p>
  
  <pre><code>    [ConfigurationProperty("labelsVisible", DefaultValue = true, IsRequired = false)]
      public bool? LabelsVisible
      {
          get
          {
  
              return (bool?)this["labelsVisible"];
  
          }
  </code></pre>
  
  <p>But when I try and use what is returned like so:</p>
  
  <pre><code>graph.Label.Visible = myConfigSection.LabelsVisible;
  </code></pre>
  
  <p>I get an error of:</p>
  
  <pre><code>'Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)  
  </code></pre>