public static string GetSetting(string name) { var result = Environment.GetEnvironmentVariable(name); if (string.IsNullOrWhiteSpace(result)) { result = ConfigurationManager.AppSettings[name]; } return result; }