public async Task <IEnumerable <ProjectRestoreReference> > GetProjectReferencesAsync( Common.ILogger logger, CancellationToken token) { var references = await _workspaceService.GetProjectReferencesAsync(_fullProjectPath); return(references .Select(reference => new ProjectRestoreReference { ProjectPath = reference, ProjectUniqueName = reference }) .ToList()); }
private static async Task AddProjectReferencesAsync( IDeferredProjectWorkspaceService deferredWorkspaceService, ProjectRestoreMetadata metadata, string projectPath) { var references = await deferredWorkspaceService.GetProjectReferencesAsync(projectPath); foreach (var reference in references) { var restoreReference = new ProjectRestoreReference() { ProjectPath = reference, ProjectUniqueName = reference }; foreach (var frameworkInfo in metadata.TargetFrameworks) { frameworkInfo.ProjectReferences.Add(restoreReference); } } }
public async Task <IEnumerable <string> > GetReferencedProjectsAsync() { if (!IsDeferred) { if (Project.Kind != null && SupportedProjectTypes.IsSupportedForAddingReferences(Project.Kind)) { return(EnvDTEProjectUtility.GetReferencedProjects(Project).Select(p => p.UniqueName)); } return(Enumerable.Empty <string>()); } else { if (ProjectTypeGuids.All(SupportedProjectTypes.IsSupportedForAddingReferences)) { return(await _workspaceService.GetProjectReferencesAsync(FullProjectPath)); } return(Enumerable.Empty <string>()); } }