static NameValueCollection loadConfigJson(string appSettings) { if (ConfigRoot == null) { var builder = new ConfigurationBuilder() .SetBasePath(FileUtil.GetBasePath()) .AddJsonFile(appSettings, optional: false, reloadOnChange: true) .AddEnvironmentVariables(); ConfigRoot = builder.Build(); } languages = new Hashtable(StringComparer.OrdinalIgnoreCase); NameValueCollection cfg = new NameValueCollection(StringComparer.Ordinal); //Case sensitive foreach (var c in ConfigRoot.GetSection("appSettings").GetChildren()) { string key = c.Key; string value = c.Value; if (EnvVarReader.GetEnvironmentValue(key, out string envVarValue)) { value = envVarValue; } cfg.Add(key, value); } foreach (var c in ConfigRoot.GetSection("languages").GetChildren()) { languages[c.Key] = new Hashtable(StringComparer.OrdinalIgnoreCase); Hashtable language = (Hashtable)languages[c.Key]; foreach (var prop in c.GetChildren()) { language[prop.Key] = prop.Value; } } return(cfg); }