title: How to hardcode and read a string array in appSettings.json?
body: <p>I use VSCode and NetCore 1.1.1.</p>
  
  <p>I need to store several datapaths in my appsetting.json to let my console application know where to look for its data.</p>
  
  <p>This is an extract of the appsettings.json file:</p>
  
  <pre><code>{
  
      "ConnectionStrings":
  
      {
  
          "Database": "Filename=./Data/Database/securities_master.db"
      },
  
      "Data":
  
      {
  
       "Folders": ["E:/Data/Folder1/","E:/Data/Folder2/"]
  
      }
  }
  </code></pre>
  
  <p>I load the configuration file and I want the "Folders" array stored in a variable:</p>
  
  <pre><code>const string APP_SETTINGS_SECTION = "Data";
  const string APP_SETTINGS_KEY = "Folders";
  
  var builder = new ConfigurationBuilder().AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
  var configuration = builder.Build();
  var dataFolders = configuration.GetSection(APP_SETTINGS_SECTION)[APP_SETTINGS_KEY];
  </code></pre>
  
  <p><code>dataFolders</code> is <strong>NULL</strong>!</p>
  
  <p>If I change my appsetting.json to point only to a single directory like this, everything works:</p>
  
  <pre><code>{
  
      "ConnectionStrings":
  
      {
  
          "Database": "Filename=./Data/Database/securities_master.db"
      },
  
      "Data":
  
      {
  
       "Folders": "E:/Data/Folder1/"   
      }
  }
  </code></pre>
  
  <p><code>dataFolder</code> = "<strong>E:/Data/Folder1/</strong>" </p>
  
  <p>So the problem appears to be it doesn't like the string array but to me it looks like a valid Json string array. How should I modify my appsettings (or my C# code) to fix this?</p>