Thursday November 26th

Wednesday November 25th

3 Kicks

Where are my Properties.Settings saved

Have you ever wondered where your user settings are saved from an .NET application? You would probably think that it's saved in the [application].exe.config(located in your application folder) file, but this is only partially true. The default values you create in Visual Studio are saved in this file. But if you change these settings at runtime: Properties.Settings.Default.myValue = "MyNewValue"; Properties.Settings.Default.Save(); they are saved to a different location. Namely the User.config file: C:\Documents and Settings\[USER]\Local Settings\Application Data\[company]\[applicationname]\[version] Note that if you should change the company name or AssemblyVersion attribute in your AssemblyInfo.cs your Settings will be saved in a new location. Since you do not override the default settings in the exe.config file, you can call the reset() method to restore the settings to its original state: Properties.Settings.Default.Reset();


Commenting on Stories is limited for now and will open up to those recommended by the community. Learn how
Loading DotNetKicks...
brought to you by the Kicks Network