0

My VSTO add-in used to save some values in the application settings using the default local user profile. In the new version I need to save to roaming profile instead. I have applied SettingsManageability attribute on these settings as suggested in this post. The settings save correctly in the roaming profile folder, but for some unknown reason, the next time my add-in loads, it reads from the old local profile again instead of roaming.

Has anyone experienced and fixed this issue?

Community
  • 1
  • 1
dotNET
  • 33,414
  • 24
  • 162
  • 251
  • I am experiencing this exact issue. Used to have local user confs, changed them to Roaming. Settings are saved in Roaming but configs in Local are prioritized. Removing the local config file causes Roaming properties to appear, though i wonder if there is another way to fix this except removing the file? – Noino Nov 02 '17 at 12:16
  • Did you by chance find a solution for this? – Noino Nov 07 '17 at 15:28
  • @Noino: mmm... don't recall now. that was 9 months ago. :) – dotNET Nov 07 '17 at 15:37

1 Answers1

0

Are you sure that you are setting SettingsManageability before reading the settings?

Leo
  • 5,013
  • 1
  • 28
  • 65
  • `SettingsManageability` is an attribute and is therefore applied declaratively. I'm not sure how I can prioritize its execution. – dotNET Feb 28 '17 at 17:56
  • in my code the property is decorated with: SettingsManageabilityAttribute and it works fine. When do you first read the settings and how? Do you use ClickOnce as deployment? – Leo Feb 28 '17 at 18:07
  • I asked whether you used ClickOnce because I remember having all sorts of this kind of issues with settings and ClickOnce. According to MSDN: ClickOnce does not work with roaming settings, which allows your settings file to follow you across machines on a network. https://msdn.microsoft.com/en-us/library/ms228995.aspx?f=255&MSPPError=-2147217396 – Leo Feb 28 '17 at 18:12
  • No ClickOnce here. I'm using MSI setup for my add-in. Settings are read automatically when the add-in is loaded. I check their value in Settings_Loaded event, where they bring in old values from local profile. – dotNET Mar 01 '17 at 06:14