Roaming Settings Using LocalFileSettingsProvider

On my way, whipping up a Windows Forms application, I thought it would be nice to use a settings file to store various application parameters (instead of the registry) and user parameters (window position, column order, etc.). Out of the box, quick and easy, or so I thought.

Everything works on MSDN using DefaultProvider (LocalFileSettingsProvider), but I have problems with where it is stored, and hopefully someone can provide a solution. In essence, the file falls into the data of the local application and into the nonrandom subdirectory structure. (AppData / Local / company / namespace_StrongName_gibberish / version).

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

+3
source share
3 answers

You pretty much have to implement your own. This is a good starting point.

+2
source

You can use SettingsManageabilityAttribute to save the settings in the roaming directory:

[SettingsManageability(SettingsManageability.Roaming)]
+3
source

Source: https://habr.com/ru/post/1696618/


All Articles