title: Why does ConfigurationValidator validate the default value of a ConfigurationProperty even if IsRequired is true?
body: <p>Let's say I have a configuration property that looks like this. Note that there is no default value.</p>
  
  <pre><code>[ConfigurationProperty("x", IsRequired = true)]
  [StringValidator(MinLength = 1)]
  public string X
  {
      get { return (string)this["x"]; }
      set { this["x"] = value; }
  }
  </code></pre>
  
  <p>Now I add my section like this:</p>
  
  <pre><code>&lt;mySection x="123" /&gt;
  </code></pre>
  
  <p>I'll get this error:</p>
  
  <blockquote>
    <p>The value for the property 'x' is not
    valid. The error is: The string must
    be at least 1 characters long.</p>
  </blockquote>
  
  <p>It works if I change the configuration property to include a default like this:</p>
  
  <pre><code>[ConfigurationProperty("x", DefaultValue="abc", IsRequired = true)]
  [StringValidator(MinLength = 1)]
  public string X
  {
      get { return (string)this["x"]; }
      set { this["x"] = value; }
  }
  </code></pre>
  
  <p>This implies that validator validates the default value even if IsRequired is true. It also means that I have to include a dummy default values on all my properties to pass validation even though they won't actually be used.</p>
  
  <p>Is this just bad design or is there a valid reason for this behavior?</p>