title: Reading config sections using Custom config classes in C# and converting them to a list
body: <p>I have this in my <code>app.config</code> file:</p>
  
  <pre><code>&lt;Configuration&gt;
   &lt;configsections&gt;
    &lt;section name="FeaturesSection" type="SampleCatalog.FeaturesSection" /&gt;
   &lt;/configsections&gt;
   &lt;FeaturesSection&gt;
     &lt;Feature Name="CCH" US="true" EM="false" Sequence="1" /&gt;
     &lt;Feature Name="PLT" US="true" EM="false" Sequence="1" /&gt;
     &lt;Feature Name="PD" US="true" EM="false" Sequence="1" /&gt;
   &lt;/FeaturesSection&gt;
  &lt;Configuration&gt;
  </code></pre>
  
  <p>My code in the class goes as below:</p>
  
  <pre><code>public class FeaturesSection:ConfigurationSection
  {
   public FeatureCollection Features
   {
      get{return (FeatureCollection)base["Features"};
   }
  }
  
  public class FeatureCollection:ConfigurationElementCollection
  {
     public Feature this[int index]{
       get{ return (Feature)BaseGet(index);}
       set{
          if(BaseGet(index)!= null)
            BaseRemoveAt(index);
          BaseAdd(index,value);
          }
      }
  
      protected override ConfigurationElement CreateNewElement()
      {
        return new Feature();
      }
  
      protected override object GetElementKey(ConfigurationElement          element){
        return ((Feature)element);
      }
  }
  
  public class Feature: ConfigurationElement
  {
     [ConfigurationProperty("Name",IsRequired=true)]
     public string Name {get; set;}
  
     [ConfigurationProperty("US",IsRequired=true)]
     public bool US {get; set;}
  
     [ConfigurationProperty("EM",IsRequired=true)]
     public bool EM {get; set;}
  
     [ConfigurationProperty("Sequence",IsRequired=true)]
     public string Sequence {get; set;}
    }
  </code></pre>
  
  <p>Now when I run this code:</p>
  
  <pre><code>var mysection = (FeaturesSection)ConfigurationManager.GetSection("FeaturesSection");
  </code></pre>
  
  <p>I'm getting exceptions. </p>
  
  <blockquote>
    <p>An error occurred creating the configuration section handler for FeaturesSection: Could not load type 'SampleCatalog.FeaturesSection' from assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. (C:\Users\Venkata_Poruri_Pavan\Documents\Visual Studio 2013\Projects\SampleCatalog\SampleCatalog\bin\Debug\SampleCatalog.vshost.exe.Con‌​fig line 4) </p>
  </blockquote>
  
  <p>Please help, kindly accept my apologies as I couldn't paste the code here.</p>
  
  <p>Thanks</p>