public static IEnumerable <string> GetProjectReferenceDependencyFilePathsRecursive(ProjectFileModel projectFileModel, string projectFilePath, HashSet <string> pathAccumulator)
        {
            var dependencyProjectFilePaths = projectFileModel.GetProjectReferenceDependencyFilePaths(projectFilePath);

            foreach (var dependencyProjectFilePath in dependencyProjectFilePaths)
            {
                if (!pathAccumulator.Contains(dependencyProjectFilePath))
                {
                    pathAccumulator.Add(dependencyProjectFilePath);
                    yield return(dependencyProjectFilePath);
                }

                var dependencyProjectFile = ProjectFileModel.Load(dependencyProjectFilePath);

                var dependencyDependencyProjectFilePaths = dependencyProjectFile.GetProjectReferenceDependencyFilePathsRecursive(dependencyProjectFilePath);
                foreach (var dependencyDependencyProjectFilePath in dependencyDependencyProjectFilePaths)
                {
                    if (!pathAccumulator.Contains(dependencyDependencyProjectFilePath))
                    {
                        pathAccumulator.Add(dependencyDependencyProjectFilePath);
                        yield return(dependencyDependencyProjectFilePath);
                    }
                }
            }
        }
        public static IEnumerable <string> GetProjectReferenceDependencyFilePaths(string projectFilePath)
        {
            var projectFile = ProjectFileModel.Load(projectFilePath);

            var projectReferenceDependencyFilePaths = Utilities.GetProjectReferenceDependencyFilePaths(projectFile, projectFilePath);

            return(projectReferenceDependencyFilePaths);
        }
        public static IEnumerable <string> GetProjectReferenceDependencyFilePathsRecursive(string projectFilePath, HashSet <string> pathAccumulator)
        {
            var projectFile = ProjectFileModel.Load(projectFilePath);

            var projectReferenceDependencyFilePaths = Utilities.GetProjectReferenceDependencyFilePathsRecursive(projectFile, projectFilePath, pathAccumulator);

            return(projectReferenceDependencyFilePaths);
        }
        /// <summary>
        /// Adds the dependency project file as a project-reference dependency to the project file.
        /// </summary>
        public static void AddProjectReference(string projectFilePath, string dependencyProjectFilePath)
        {
            var projectFile = ProjectFileModel.Load(projectFilePath);

            projectFile.AddProjectReference(projectFilePath, dependencyProjectFilePath);

            projectFile.Save(projectFilePath);
        }