19 references to AddProjectReferences
Microsoft.CodeAnalysis.Workspaces (4)
Workspace\ProjectSystem\ProjectSystemProject.cs (2)
609solutionChanges.Solution.AddProjectReferences(Id, projectReferencesCreated) 618newSolution: solutionChanges.Solution.AddProjectReferences(Id, _projectReferencesAddedInBatch));
Workspace\Solution\Project.cs (1)
592=> this.Solution.AddProjectReferences(this.Id, projectReferences).GetProject(this.Id)!;
Workspace\Solution\Solution.cs (1)
608return AddProjectReferences(projectId,
Microsoft.CodeAnalysis.Workspaces.UnitTests (15)
SolutionTests\ProjectDependencyGraphTests.cs (1)
735return solution.AddProjectReferences(
SolutionTests\SolutionTests.cs (14)
1410var solution2 = solution.AddProjectReferences(projectId, EmptyEnumerable<ProjectReference>()); 1415var solution3 = solution.AddProjectReferences(projectId, e); 1419Assert.Throws<ArgumentNullException>("projectId", () => solution.AddProjectReferences(null!, new[] { projectRef2 })); 1420Assert.Throws<ArgumentNullException>("projectReferences", () => solution.AddProjectReferences(projectId, null!)); 1421Assert.Throws<ArgumentNullException>("projectReferences[0]", () => solution.AddProjectReferences(projectId, new ProjectReference[] { null! })); 1422Assert.Throws<ArgumentException>("projectReferences[1]", () => solution.AddProjectReferences(projectId, new[] { projectRef2, projectRef2 })); 1423Assert.Throws<ArgumentException>("projectReferences[1]", () => solution.AddProjectReferences(projectId, new[] { new ProjectReference(projectId2), new ProjectReference(projectId2) })); 1426Assert.Throws<InvalidOperationException>(() => solution.AddProjectReferences(projectId3, new[] { projectRef2 })); 1429Assert.Throws<InvalidOperationException>(() => solution3.AddProjectReferences(projectId2, new[] { projectRef3 })); 1430Assert.Throws<InvalidOperationException>(() => solution3.AddProjectReferences(projectId, new[] { new ProjectReference(projectId) })); 1488_ = solution.AddProjectReferences(submissionId3, new[] { new ProjectReference(submissionId1) }); 1492_ = solution.AddProjectReferences(submissionId3, new[] { new ProjectReference(projectId0) }); 1496Assert.Throws<InvalidOperationException>(() => solution.AddProjectReferences(submissionId2, new[] { new ProjectReference(submissionId3) })); 1500Assert.Throws<InvalidOperationException>(() => solution.AddProjectReferences(projectId0, new[] { new ProjectReference(submissionId1) }));