.Settings file in a Win Form application, best practice

I have a Win Form application that stores some settings for each user in the UserSettings.Settings file. This has worked well so far, however it seems that the settings file is getting "reset" when I release the update. What am I doing through ClickOnce.

Is this the expected behavior?
Can I control if the fields in the settings file are overwritten?
Is there a better way to save user preferences?

thank

+3
source share
4 answers

ApplicationSettingsBase.Upgrade Method . : "" app.config?

, , , , , Upgrade - :

if(!Settings.Default.Upgraded)
{
   Settings.Default.Upgrade();
   Settings.Default.Upgraded = true;
   Settings.Default.Save();
}

, . , .

+4

ClickOnce?

, Scope , ,

, ClickOnce , ClickOnce . , ( ) , , .

+1

Windows Vista/7 :

C:\Users\USERNAME\AppData\Local\MANUFACTURER_NAME\

C:\Users\USERNAME\AppData\Roaming\MANUFACTURER_NAME\

im , xp.

, . .

0

All Articles