WPF: Changing config file user settings at runtime?

Posted by Poku on Stack Overflow See other posts from Stack Overflow or by Poku
Published on 2010-03-16T09:09:13Z Indexed on 2010/03/16 9:16 UTC
Read the original article Hit count: 495

Filed under:
|
|

Hey

I'm trying to change some config file user settings values in my WPF application, but its only working partly. The value is changed correctly and the program runs fine with the value. I can even restart the program and the value is still the one i changed it to. The problem is that when i open the .exe.config file the value is still the old value. Im using this code to change the value:

Properties.Settings.Default.ProjectNumber = varTestExample;
Properties.Settings.Default.Save();

Where does this save code save the changes and how/where does the program read the value after i have run this code? If i run a clean version of the program the ProjectNumber value is correctly taken from the .exe.config file and if i change the value in the config file it is also change when i run the program. But as soon as i run the above code the program is not reading the value from the config file. Why?

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf