private async void ExecuteAsync(object sender, EventArgs e) { var solution = (IVsSolution)ServiceProvider.GetService(typeof(SVsSolution)); IEnumerable <IVsHierarchy> hierarchies = VsHelpers.GetProjectsInSolution(solution, __VSENUMPROJFLAGS.EPF_LOADEDINSOLUTION); var configFiles = new List <string>(); foreach (IVsHierarchy hierarchy in hierarchies) { Project project = VsHelpers.GetDTEProject(hierarchy); if (VsHelpers.ProjectContainsManifestFile(project)) { string configFilePath = Path.Combine(project.GetRootFolder(), Constants.ConfigFileName); configFiles.Add(configFilePath); } } await LibraryHelpers.RestoreAsync(configFiles); Telemetry.TrackUserTask("restoresolution"); }
private async Task ExecuteAsync(object sender, EventArgs e) { Telemetry.TrackUserTask("Execute-RestoreSolutionCommand"); var solution = (IVsSolution)ServiceProvider.GetService(typeof(SVsSolution)); IEnumerable <IVsHierarchy> hierarchies = VsHelpers.GetProjectsInSolution(solution, __VSENUMPROJFLAGS.EPF_LOADEDINSOLUTION); var configFiles = new List <string>(); foreach (IVsHierarchy hierarchy in hierarchies) { Project project = VsHelpers.GetDTEProject(hierarchy); if (await VsHelpers.ProjectContainsManifestFileAsync(project)) { string rootPath = await project.GetRootFolderAsync(); string configFilePath = Path.Combine(rootPath, Constants.ConfigFileName); configFiles.Add(configFilePath); } } await _libraryCommandService.RestoreAsync(configFiles, CancellationToken.None); }