title: ConfigurationManager - Configuration Section error
body: <p>I want a configuration section that looks like this:</p>
  
  <pre><code>&lt;MailMessage&gt;
    &lt;from value="me@you.com" /&gt;
    &lt;subject value ="Subject goes here" /&gt;
    &lt;body value="Hello. You've got mail!" /&gt;
  &lt;/MailMessage&gt;
  </code></pre>
  
  <p>And I have implemented the classes like in the second answer of this link:
  <a href="https://stackoverflow.com/questions/3935331/how-to-implement-a-configurationsection-with-a-configurationelementcollection">How to implement a ConfigurationSection with a ConfigurationElementCollection</a></p>
  
  <p>Now for me the elements of MailMessage section are not a collection but this should not be a problem but I receive the error when I try to access the property:</p>
  
  <pre><code>Unrecognized element 'from'
  </code></pre>
  
  <p>I get the section with the code:</p>
  
  <pre><code>private static MailMessageSection emailSection = ConfigurationManager.GetSection("MailMessage") as MailMessageSection;
  </code></pre>
  
  <p>Here is the implementation of the elements:</p>
  
  <pre><code>public class MailMessageSection : ConfigurationSection
  {
  
      [ConfigurationProperty("from")]
      public FromElement From
      {
             get { return base["from"] as FromElement; }
      }
      [ConfigurationProperty("subject")]
      public SubjectElement Subject
      {
          get { return base["subject"] as SubjectElement; }
      }
      [ConfigurationProperty("body")]
      public BodyElement Body
      {
          get { return base["body"] as BodyElement; }
      }
  
  }
  public class FromElement : ConfigurationElement
  {
     [ConfigurationProperty("value")]
      public string From
      {
          get { return base["value"] as string; }
      }
  }
  public class SubjectElement : ConfigurationElement
  {
  
      [ConfigurationProperty("value")]
      public string Subject
      {
          get { return base["value"] as string; }
      }
  }
  public class BodyElement : ConfigurationElement
  {
  
      [ConfigurationProperty("value")]
      public string Body
      {
          get { return base["value"] as string; }
      }
  }
  </code></pre>
  
  <p>Any ideas what could be wrong? Thanks for your time!</p>