<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="MySetting1" value="1"/>
<add key="MySetting2" value="2"/>
</appSettings>
</configuration>
public static class SettingsProxy
{
public static string MySetting1 { get; set; }
public static string MySetting2 { get; set; }
public static void Load()
{
var type = typeof(SettingsProxy);
foreach (var p in type.GetProperties())
{
var value = ConfigurationManager.AppSettings[p.Name];
p.SetValue(null, value);
}
}
}