title: ConfigurationManager.GetSection() returns null, how to fix this
body: <p>Maybe this question is already answered, but I haven't seen anything that works for me.</p>
  
  <p>The issue is the following: I can't read from app.config and I don't know what I am doing wrong, basically the idea is to get the object CcgSettingCcg which is of Type CcgSettings. In the future, I plan to add other settings, always CcgSettings but with different name, lets say CcgSettingsCcg2 and so on, </p>
  
  <p>from app.config:</p>
  
  <pre><code>&lt;configSections&gt;
          &lt;sectionGroup name ="GeneralTenantEmailSettings"&gt;
              &lt;section name="TenantEmailSettings" type="DataApiService.Models.TenantEmailSettings, DataApiService.Models" /&gt;
          &lt;/sectionGroup&gt;
      &lt;/configSections&gt;
      &lt;TenantEmailSettings&gt;
          &lt;CcgSettingCcg SettingsId="520305DC-6E68-4FA3-B53B-18E25E0E21FF" TenantId="A0C55F11-516E-4F7C-9ECD-DEF7C47290B4" Frequency="168" StartDate="03/06/2020" RuleType="Default" To="Ccg" /&gt;
      &lt;/TenantEmailSettings&gt;
  </code></pre>
  
  <p>Class definitions: I am using system.Configuration here</p>
  
  <pre><code>namespace DataApiService.Models{
  public class CcgSettings : ConfigurationElement
      {
          [ConfigurationProperty("SettingsId", IsRequired=true)]
          public Guid SettingsId 
          {
              get
              {
                  return (Guid)this["SettingsId"];
              }
              set
              {
                  value = (Guid)this["SettingsId"];
              }
          }
          [ConfigurationProperty("TenantId", DefaultValue = null, IsRequired = false)]
          public Guid? TenantId
          {
              get
              {
                  return (Guid)this["TenantId"];
              }
              set
              {
                  value = (Guid)this["TenantId"];
              }
          }
          [ConfigurationProperty("Frequency", DefaultValue = 0,IsRequired = true)]
          public int Frequency
          {
              get
              {
                  return (int)this["Frequency"];
              }
              set
              {
                  value = (int)this["Frequency"];
              }
          }
          [ConfigurationProperty("StartDate", IsRequired = true)]
          public DateTime StartDate
          {
              get
              {
                  return (DateTime)this["StartDate"];
              }
              set
              {
                  value = (DateTime)this["StartDate"];
              }
          }
          [ConfigurationProperty("RuleType", DefaultValue = "default", IsRequired = true)]
          public string RuleType
          {
              get
              {
                  return (string)this["RuleType"];
              }
              set
              {
                  value = (string)this["RuleType"];
              }
          }
          [ConfigurationProperty("To", IsRequired = true)]
          public string To
          {
              get
              {
                  return (string)this["To"];
              }
              set
              {
                  value = (string)this["To"];
              }
          }
      }
  
      public class TenantEmailSettings: ConfigurationSection
      {
          [ConfigurationProperty("CcgSettings")]
          public CcgSettings CcgSettingsCcg
          {
              get
              {
                  return (CcgSettings)this["CcgSettingCcg"];
              }
              set
              {
                  value = (CcgSettings)this["CcgSettingCcg"];
              }
          }
      }
      public class GeneralTenantEmailSettings : ConfigurationSectionGroup
      {
          [ConfigurationProperty("TenantEmailSettings")]
  
          public TenantEmailSettings TenantEmailSettings
          {
              get; set;
          }
      }}
  </code></pre>
  
  <p>and finally this is where I try to read</p>
  
  <pre><code>    var t = ConfigurationManager.GetSection("TenantEmailSettings") as TenantEmailSettings; 
      var s = ConfigurationManager.GetSection("GeneralTenantSettings") as GeneralTenantEmailSettings;
      var c = ConfigurationManager.GetSection("CcgSettings") as CcgSettings;
      var b = ConfigurationManager.GetSection("CcgSettingsCcg") as CcgSettings;
  </code></pre>
  
  <p>t, s, c and b return null, this is my problem</p>