problems reading config file using AppSettings property



here is my config file (myapp.exe.config):

<supportedRuntime version="v1.1.4322" />
<add key="success" value="1" />
<add key="failure" value="1" />

and here is my Main() code (myapp.exe):

string sSuccess = ConfigurationSettings.AppSetti­­ngs["success"];
string sFailure = ConfigurationSettings.AppSetti­­ngs["failure"];
Console.WriteLine("s:" + sSuccess + " f: " + sFailure);

and here is the output:

s: f:

so my question is: why can't the code correctly read the app settings?
it seems like it should be pretty straight forward.

thanks in advance for any help


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