How to get string array from core console appSettings.json file
问题 How do I return an string[] from the IConfigurationRoot object? File exists and is set to copy to output Code var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("settings.json", optional: false, reloadOnChange: false); _configuration = builder.Build(); var arr = _configuration["stringArray"]; // this returns null var arr1 = _configuration["stringArray:0"]; // this works and returns first element Settings.json { "stringArray": [ "myString1",