reading from app.config

R

rodchar

hey all,

can someone please tell me how to get the following to work?

console app
NameValueCollection nvColl =
(NameValueCollection)ConfigurationManager.GetSection("heading1/subheading1");

app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<heading1>
<subheading1>
<add key="name1" value="value1"/>
<add key="name2" value="value2"/>
</subheading1>
</heading1>
</configuration>

i'm getting a "failed to initialize" on .GetSection call

thanks,
rodchar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top