title: How to access custom ConfigurationSection from library?
body: <p>Early, I have defined custom section in Console application and it works fine. But now I want to move some of functionality to the library. But, unfortunately, I cannot. Because now my custom section was defined as null. </p>
  
  <p>The simple console application include next code:</p>
  
  <pre><code>namespace ConsoleApplication1
  {
      class Program
      {
          static void Main(string[] args)
          {
  
              NotificationsConfigurationSection section
    = NotificationsConfigurationSection.GetSection();
              string emailAddress = section.EmailAddress;
              Console.WriteLine(emailAddress);
              Console.Read();
          }
      }
  }
  </code></pre>
  
  <p>The file with custom configuration which is situated in the separate library include next code:</p>
  
  <pre><code>namespace ClassLibrary1
  {
      public class NotificationsConfigurationSection : ConfigurationSection
      {
          private const string configPath = "cSharpConsultant/notifications";
          public static NotificationsConfigurationSection GetSection()
          {
              return (NotificationsConfigurationSection)
                ConfigurationManager.GetSection(configPath);
          }
  
          /*This regular expression only accepts a valid email address. */
          [RegexStringValidator(@"[\w._%+-]+@[\w.-]+\.\w{2,4}")]
          /*Here, we register our configuration property with an attribute. 
          Note that the default value is required if we use 
          the property validation attributes, which will unfortunately 
          attempt to validate the initial blank value if a default isn't found*/
          [ConfigurationProperty("emailAddress", DefaultValue = "Address@Domain.com")]
          public string EmailAddress
          {
              get { return (string)this["emailAddress"]; }
              set { this["emailAddress"] = value; }
          }
      }
  }
  </code></pre>
  
  <p>In app.config for the library I include next nodes:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;sectionGroup name="cSharpConsultant"&gt;
        &lt;section name="notifications"
            type="ClassLibrary1.NotificationsConfigurationSection,
          ClassLibrary1"/&gt;
      &lt;/sectionGroup&gt;
    &lt;/configSections&gt;
    &lt;cSharpConsultant&gt;
      &lt;notifications emailAddress="NotifiedPerson@Domain.com"/&gt;
    &lt;/cSharpConsultant&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Could anybody help me?</p>