tags:

views:

710

answers:

4

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?)

+1  A: 

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

Will
A: 

I was hoping that wasn’t going to be the answer, thanks.

Ant
A: 

You can use SettingsManageabilityAttribute for storing settings in roaming directory:

[SettingsManageability(SettingsManageability.Roaming)]
ondatra
A: 

see http://blogs.msdn.com/rprabhu/articles/433979.aspx for some good info about the settings topic

Heiko Leuze