2

I have a VS2010 solution with a Settings.settings file. The user settings are saved to the Local Settings folder and this is a problem as these settings do not roam.

Currently the settings file is saved automatically to:

Dim config_initial As System.Configuration.Configuration = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.PerUserRoamingAndLocal)
Console.WriteLine("Local user config path: {0}", config_initial.FilePath)

( C:\Documents and Settings\%username%\Local Settings\Application Data\%company%\%application%.exe_Url_%hash%\%version%\user.config )

Is there any way to save this file to the file path identified by:

Dim config_new As System.Configuration.Configuration = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.PerUserRoaming)
Console.WriteLine("User config path: {0}", config_new.FilePath)

( C:\Documents and Settings\%username%\Application Data\%company%\%application%.exe_Url_%hash%\%version%\user.config )

I am just saving using My.Settings.Save() or automatically when the application terminates at the moment.

Seph
  • 8,472
  • 10
  • 63
  • 94
  • This is a function of the roaming profiles. If you did this, your users settings for this app would not move with them from workstation to workstation. Is this a consequence that you are comfortable with? – brad.huffman Dec 06 '10 at 18:05
  • When proof reading I didn't notice that I had it round the wrong way. Currently it does not roam and I want the application settings to roam. – Seph Dec 06 '10 at 22:55

1 Answers1

5

I found the answer here. In Visual Studio, open the Application Settings screen, then select an individual setting, and then go to the Properties Window. There is then an option to set Roaming to True

enter image description here

Vimes
  • 10,577
  • 17
  • 66
  • 86
Seph
  • 8,472
  • 10
  • 63
  • 94