I'm using the SettingsManager
in my Visual Studio extension to store user settings.
SettingsManager settingsManager = new ShellSettingsManager(ServiceProvider.GlobalProvider);
var store = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);
I have a custom WPF Options page, as described in this post. I'd also like to set my extension up to work with the Import/Export settings, so I followed the Creating an Options Page and Creating a Settings Category pages, to add this to my package attributes:
[ProvideProfile(typeof(OptionsDialogPage), "Unit Test Boilerplate Generator", "Unit Test Boilerplate Generator Settings", 106, 107, true, DescriptionResourceID = 108)]
[ProvideOptionPage(typeof(OptionsDialogPage), "Unit Test Boilerplate Generator", "Templates", 101, 109, supportsAutomation: true)]
I successfully got it to appear as a heading under Import/Export settings, but none of my data stored with the SettingsManager
shows up after the export. I was looking over the options under ProvideProfile
and ProvideOptionPage
and tried setting SupportsProfiles = true
but that didn't help.
How do I hook the two of these systems up?
(edit) I ran Process Monitor and found the SettingsManager keys here (CollectionPath UnitTestBoilerplateGenerator):
\REGISTRY\A\{08894cfc-f3a9-f49b-133e-3453dfe7a27d}\Software\Microsoft\VisualStudio\15.0_a703f143Exp\UnitTestBoilerplateGenerator\Template_VisualStudio_Moq_File
And the built-in options stored here (example from another extension):
\REGISTRY\A\{22e40365-b8e3-e9b2-1315-55021a1e4c3d}\Software\Microsoft\VisualStudio\15.0_a703f143\ApplicationPrivateSettings\Xavalon\XamlStyler\Core\Options\StylerOptions\NoNewLineElement
So it seems like they get stored in separate areas. Is there any way to write programmatically to those built-in options or to include the custom CollectionPath in the import/export?