Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Roaming settings with LocalFileSettingsProvider

Tags:

.net

winforms

On my way through whipping up a Windows Forms application I thought it might have been a good idea to use the settings file to store miscellaneous application options (instead of the registry) and user parameters (window positions, column orderings, etc.). Out of the box, quick and simple, or so I thought.

All works as per MSDN using the default SettingsProvider (LocalFileSettingsProvider), but I do have concerns about where it gets stored and hopefully somebody can provide a solution. Essentially the file ends up in the local application data and in an unsavoury sub-directory structure. (AppData / Local / company / namespace_StrongName_gibberish / version ).

Is there a way to tell the LocalFileSettingsProvider to store the configuration file so the data will roam and perhaps in a less crazy folder structure? (or maybe an implementation of SettingsProvider that already does this?)

like image 785
Ant Avatar asked Dec 14 '25 21:12

Ant


1 Answers

You can use SettingsManageabilityAttribute for storing settings in roaming directory:

[SettingsManageability(SettingsManageability.Roaming)]
like image 127
Tereza Tomcova Avatar answered Dec 17 '25 22:12

Tereza Tomcova



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!