By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,949 Members | 1,455 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,949 IT Pros & Developers. It's quick & easy.

Crazy ConfigurationManager

P: n/a
Tom
This seems odd ...

While debugging my application in VS2008, I can successfully retrieve values
from my configuration file doing the following:

string bla = ConfigurationManager.AppSettings["myValue"];

I can also successfully save to the config file doing the following:

Configuration c =
ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.None);
c.AppSettings.Settings.Remove("myValue");
c.AppSettings.Settings.Add("myValue", "ItsActualValue");
c.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings") ;

If I go into my debug directory on my file system and check my exe config
file, I can actually see that these settings have successfully been written
to the config file.

Here's the weird part:
When I'm finished debugging my app, I stop it by hitting (shift + F5). When
I do that, my exe config file somehow reverts back to the original state in
which these settings did not exist in the config file.

WTH?!?

Aug 8 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.