mam plik app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="ApiParameters" type="System.Configuration.DictionarySectionHandler" />
</configSections>
<SmsSerwerApiParameters>
<add key="login" value="testLogin"/>
<add key="haslo" value="foobar"/>
</SmsSerwerApiParameters>
</configuration>
próbując czytać to w ten sposób dostaję nulla.
public static Dictionary<string, string> GetConfig()
{
var c = (ConfigurationManager.GetSection("ApiParameters") as Hashtable)
.Cast<DictionaryEntry>()
.ToDictionary(n => n.Key.ToString(), n => n.Value.ToString());
return c;
}