Reputation: 13842
I know that Visual Studio 2017 now supports no-registry, side-by-side installations of all SKUs (Enterprise, Professional and Community) explanations here.
We need to access the list of VS2017 Most Recently Used (MRU) solutions and projects.
For previous VS2017 version we used to query the registry for that.
Ideally this could be done from the VS setup API but I cannot find any sample code.
Else we can still rely on the RegLoadAppKey() function as explained in this VS 2017 breaking change article (any code is welcome)
Or maybe there is another API to do that?
Thanks for your help,
Upvotes: 5
Views: 1144
Reputation: 86
The recommended way to access VS 2017 settings is to use the External Settings Manager:
ExternalSettingsManager ext = ExternalSettingsManager.CreateForApplication(@"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe");
SettingsStore store = ext.GetReadOnlySettingsStore(SettingsScope.UserSettings);
foreach (string name in store.GetPropertyNames(@"MRUItems\{a9c4a31f-f9cb-47a9-abc0-49ce82d0b3ac}\Items"))
{
string value = store.GetString(@"MRUItems\{a9c4a31f-f9cb-47a9-abc0-49ce82d0b3ac}\Items", name);
Console.WriteLine("Property name: {0}, value: {1}", name, value);
}
To use the External Settings Manager you need to add a reference to Microsoft.VisualStudio.Settings.15.0.dll to your project.
Upvotes: 7