我正在尝试将扩展创建的项目添加到最近的项目和解决方案命令中。我能够通过这段代码获得命令列表
var mruPath = @"MRUItems\{a9c4a31f-f9cb-47a9-abc0-49ce82d0b3ac}\Items";
String exeName = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileVersionInfo.FileName;
using (ExternalSettingsManager ext = ExternalSettingsManager.CreateForApplication(exeName))
{
WritableSettingsStore store = ext.GetWritableSettingsStore(SettingsScope.UserSettings);
var mruList = new ArrayList();
string solPath = dte.Solution.FullName;
string solName = solPath.Split('\\').Last();
solName = solName.Split('.').First();
string newPath = newsolPath + @"|{00000000-0000-0000-0000-000000000000}|False|" + solName + @"||||{00000000-0000-0000-0000-000000000000}";
store.SetString(mruPath, "0", newPath);
names = store.GetPropertyNames(mruPath);
foreach (string name in names)
{
string value = store.GetString(mruPath, name);
string[] subValue = value.Split('|');
mruList.Add(subValue[0]);
}
}
我正在尝试将 newPath 添加到列表中,但它没有添加,我不明白为什么。有人可以帮我解决这个问题吗?