title: ConfigurationSection class (.Net) difficulty
body: <p>I'm having difficulty making this ConfigurationSection implementation work. The goal here is to have a configurable map of file extensions to MIME file types. I followed two tutorials trying to arrive at this design, and never got either to work. I suspect it is because the call <code>ConfigurationManager.GetSection("extensionFiletypes") as FilenameExtensionTypeConfiguration</code> returns <code>null</code>. What am I doing wrong and how do I fix it?</p>
  
  <p><strong>App.config</strong></p>
  
  <pre><code>&lt;configuration&gt;
      &lt;configSections&gt;
          &lt;section name="extensionFiletypes" type="Models.Config.FilenameExtensionTypeConfiguration, Models.Config"/&gt;
      &lt;/configSections&gt;
      &lt;extensionFiletypes&gt;
          &lt;collection&gt;
              &lt;add extension="acx" type="application/internet-property-stream" /&gt;
              &lt;add extension="ai" type="application/postscript" /&gt;
              ...
              &lt;add extension="z" type="application/x-compress" /&gt;
              &lt;add extension="zip" type="application/zip" /&gt;
          &lt;/collection&gt;
      &lt;/extensionFiletypes&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>Classes:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Configuration;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace Models.Config
  {
      public sealed class FilenameExtensionTypeConfiguration : ConfigurationSection
      {
          public static FilenameExtensionTypeConfiguration GetConfiguration()
          {
              var configuration = ConfigurationManager.GetSection("extensionFiletypes") as FilenameExtensionTypeConfiguration;
              return configuration ?? new FilenameExtensionTypeConfiguration();
          }
  
      ...
  }
  </code></pre>