title: C# - ConfigurationSection isRequired attribute
body: <p>I'm having this wierd problem... in my code whether I set the value of IsRequired to false or true then it stays false.. However if I put in a DefaultValue it works?</p>
  
  <p>The non-working code is:</p>
  
  <pre><code>public class FtpSettingsSection : ConfigurationSection
  {
      [ConfigurationProperty("host", IsRequired = true)]
      public HostElement Host
      {
          get { return (HostElement)this["host"]; }
          set { this["host"] = value; }
      }
  
  }
  
  public class HostElement : ConfigurationElement
  {
      [ConfigurationProperty("URL", IsRequired = true)]
      public string URL
      {
          get { return (string)this["URL"]; }
          set { this["URL"] = value; }
      }
  }
  </code></pre>
  
  <p>and the working code is:</p>
  
  <pre><code>public class FtpSettingsSection : ConfigurationSection
  {
      [ConfigurationProperty("host", DefaultValue = "", IsRequired = true)]
      public HostElement Host
      {
          get { return (HostElement)this["host"]; }
          set { this["host"] = value; }
      }
  
  }
  
  public class HostElement : ConfigurationElement
  {
      [ConfigurationProperty("URL", DefaultValue = "", IsRequired = true)]
      public string URL
      {
          get { return (string)this["URL"]; }
          set { this["URL"] = value; }
      }
  }
  </code></pre>
  
  <p>How come that I need to set DefaultValue to ""?</p>