problems reading config file using AppSettings property


J

jason

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

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


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
 
Ad

Advertisements


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