winforms - .Settings file in Win Form App, Best Practice -


I have a Win Form App that stores some user settings in the UserSettings.Settings file. It has done a good job till now, although it seems that whenever I issue an update, the settings file is "reset," which I will do through ClickOnce < P> Is this the expected behavior?
Can control overwrite the file on settings? Should I save user settings in a better way?

Thanks

When you issue an update, your updated The app must call the values ​​from the previous version to move. Here's a common question:

Keep in mind that you should only call the method above once so that you may have to store whether you have already upgraded or not in settings and Do anything like this:

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

Another possible solution is to store settings in a folder that is not dependent on the application version. In that case you will not lose the value and there will be no need to upgrade settings between versions.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -