/// <summary> /// Adds a project reference to the solution's dependencies folder, but checks first to avoid adding duplicates. /// </summary> public static void AddProjectReferenceDependencyChecked(this SolutionFile solutionFile, SolutionFileProjectReference projectReference) { var hasProjectReference = solutionFile.HasProjectReference(projectReference); if (!hasProjectReference) { solutionFile.AddProjectReferenceAsDependency(projectReference); } }
public static void AddProjectReferenceAsDependency(this SolutionFile solutionFile, string solutionFilePath, string projectFilePath) { var projectReference = SolutionFileProjectReference.NewNetCoreOrStandard(solutionFilePath, projectFilePath); solutionFile.AddProjectReferenceAsDependency(projectReference); }