title: getting Error: Unrecognized element 'grow'. while reading config file
body: <p>This is App.Config File:</p>
  
  <pre><code>&lt;configuration&gt;
  
    &lt;configSections&gt;
      &lt;section name="StartupFolders" type="ConfigSectionTester.StartupFoldersConfigSection, ConfigSectionTester"/&gt;
    &lt;/configSections&gt;
  
    &lt;StartupFolders nick ="abc"&gt;
  
      &lt;Folder&gt;                                    
        &lt;grow reader-type="PBV" /&gt;
        &lt;add folderType="A" path="C:\foo" /&gt;    
        &lt;add folderType="B" path="B:\foo1" /&gt;
        &lt;add folderType="C"  /&gt;
      &lt;/Folder&gt;
  
      &lt;Files nikkie ="deaf"&gt;
        &lt;add fileType="File 1" /&gt;  
      &lt;/Files&gt;
  
    &lt;/StartupFolders&gt;
  
  &lt;/configuration&gt;   
  </code></pre>
  
  <p>These are my classes: (Focus on "grow" as thats actually creating the issue)</p>
  
  <pre><code>namespace ConfigSectionTester
  {
      class Program
      {
          static void Main(string[] args)
          {
              StartupFoldersConfigSection section = (StartupFoldersConfigSection)ConfigurationManager.GetSection("StartupFolders");
  
              if (section != null)
              {
                  System.Diagnostics.Debug.WriteLine(section.FolderItems[0].FolderType);
                  System.Diagnostics.Debug.WriteLine(section.FolderItems[0].Path);
  
                  using (StreamWriter writer = new StreamWriter(@"D:\Sadiq\Sadiq.txt"))
                  {
                      try
                      {
                          writer.WriteLine(section.FolderItems[1].FolderType);
                          writer.WriteLine(section.Nick);
                          writer.WriteLine(section.FileItems.Nikkie);
                          writer.WriteLine(section.FolderItems[1].Path);
                          writer.WriteLine(section.FolderItems[2].Path);
                          writer.WriteLine(section.FileItems[0].FileType);
                      }
                      catch (Exception ex)
                      {
                          Console.WriteLine(typeof(ConfigSectionTester.StartupFoldersConfigSection) + ":" + ex.TargetSite + ex.Message);
                      }
  
                  }
              }
          }
      }
  
      public class FolderElement : ConfigurationElement
      {    
          [ConfigurationProperty("folderType", DefaultValue = "", IsKey = true, IsRequired = true)]
          public string FolderType
          {
              get
              {
                  return ((string)(base["folderType"]));
              }
              set
              {
                  base["folderType"] = value;
              }
          }
  
          [ConfigurationProperty("path", DefaultValue = "", IsKey = false, IsRequired = false)]
          public string Path
          {
              get
              {
                  return ((string)(base["path"]));
              }
              set
              {
                  base["path"] = value;
              }
          }
      }
  
      public class FileElement : ConfigurationElement
      {
          [ConfigurationProperty("fileType", DefaultValue = "", IsKey = true, IsRequired = true)]
          public string FileType
          {
              get
              {
                  return ((string)base["fileType"]);
              }
              set
              {
                  base["fileType"] = value;
              }
          }
      }
  
      [ConfigurationCollection(typeof(FileElement))]
      public class FileCollection : ConfigurationElementCollection
      {
          [ConfigurationProperty("nikkie", DefaultValue = "")]
          public string Nikkie
          {
              get { return (string)this["nikkie"]; }
              set { this["nikkie"] = value; }
          }
  
          protected override ConfigurationElement CreateNewElement()
          {
              return new FileElement();
          }
  
          protected override object GetElementKey(ConfigurationElement element)
          {
              return ((FileElement)element).FileType;
          }
          public FileElement this[int ind]
          {
              get
              {
                 //   return (FileElement)this[ind];
                  return (FileElement)BaseGet(ind);
              }
          }
      }
  
      [ConfigurationCollection(typeof(FolderElement))]
      public class FoldersCollection : ConfigurationElementCollection
      {
          protected override ConfigurationElement CreateNewElement()
          {
              return new FolderElement();
          }
  
          protected override object GetElementKey(ConfigurationElement element)
          {
              return ((FolderElement)(element)).FolderType;
          }
  
          public FolderElement this[int idx]
          {
              get
              {
                  return (FolderElement)BaseGet(idx);
              }
          }
      }
  
      public class Grow : ConfigurationElement
      {
          [ConfigurationProperty("reader-type")]
          public string ReaderType
          {
              get
              {
                  return ((string)base["reader-type"]);
              }
              set
              {
                  base["reader-type"] = value;
              }
          }
      }
  
      public class StartupFoldersConfigSection : ConfigurationSection
      {
          [ConfigurationProperty("nick", DefaultValue = "8.5")]
          public string Nick
          {
              get { return (string)this["nick"]; }
              set { this["nick"] = value; }
          }
  
          [ConfigurationProperty("Folder")]
          public FoldersCollection FolderItems
          {
              get
              {
                  return ((FoldersCollection)(base["Folder"]));
              }
          }
  
          [ConfigurationProperty("Files")]
          public FileCollection FileItems
          {
              get
              {
                  return ((FileCollection)(base["Files"]));
              }
          }
  
          [ConfigurationProperty("grow")]
          public Grow GrowAtt
          {
              get { return (Grow)base["grow"]; }
          }
      }
  }
  </code></pre>
  
  <p>Every thing worked fine until I added:</p>
  
  <pre><code> &lt;grow reader-type="PBV" /&gt;
  </code></pre>
  
  <p>I'm getting following error:</p>
  
  <p>Unrecognized element 'grow'. </p>
  
  <p>I'm new to this. What am I doing wrong?</p>