Pat*_*eam 4 mru visual-studio visual-studio-2017
我知道的Visual Studio 2017年现在支持无注册,并排侧所有SKU(企业版,专业版和社区)解释安装在这里.
我们需要访问VS2017最近使用(MRU)解决方案和项目的列表.
对于以前的VS2017版本,我们用于查询注册表.
理想情况下,这可以从VS setup API完成,但我找不到任何示例代码.
另外,我们仍然可以依赖RegLoadAppKey()函数,如本VS 2017 破坏性更改文章中所述(欢迎任何代码)
或者可能还有其他API可以做到这一点?
谢谢你的帮助,
小智 6
访问VS 2017设置的推荐方法是使用外部设置管理器:
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);
}
要使用外部设置管理器,您需要将Microsoft.VisualStudio.Settings.15.0.dll的引用添加到项目中.
| 归档时间: | 
 | 
| 查看次数: | 601 次 | 
| 最近记录: |