Programmatically find solutions and projects VS2017 for the latest applications (MRU)

I know that Visual Studio 2017 now supports the lack of a registry, side-by-side installation of all SKUs (Enterprise, Professional, and Community) explanations here .

We need to access the list of VS2017 most used (MRU) solutions and projects.

For the previous version of VS2017, we used a query in the registry for this.

  • This registry code always works fine when it is launched from the VS2017 devenv process,
  • but it no longer works when it runs in a standalone / custom process (I mean a process that is not a VS2017 devenv process) and this is what we need to do .

Ideally, this can be done from the VS installation API , but I cannot find any sample code.

Otherwise, we can still rely on the RegLoadAppKey () function, as described in this VS 2017, which posted an article about the changes (any code is welcome)

Or maybe there is another API?

Thank you for your help,

+2
visual-studio visual-studio-2017 mru
source share
1 answer

The recommended way to access VS 2017 settings is to use 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 link to Microsoft.VisualStudio.Settings.15.0.dll in your project.

+4
source share

All Articles