18 references to WithProjectReferences
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\RemoteWorkspace.SolutionCreator.cs (1)
157solution = solution.WithProjectReferences(projectId, SpecializedCollections.EmptyEnumerable<ProjectReference>());
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
605=> this.Solution.WithProjectReferences(this.Id, projectReferences).GetProject(this.Id)!;
Microsoft.CodeAnalysis.Workspaces.UnitTests (16)
SolutionTests\ProjectDependencyGraphTests.cs (3)
217solution = solution.WithProjectReferences(solution.GetProjectsByName("C").Single().Id, 317solution = solution.WithProjectReferences(solution.GetProjectsByName("A").Single().Id, 397solution = solution.WithProjectReferences(solution.GetProjectsByName("C").Single().Id,
SolutionTests\SolutionTests.cs (13)
1354(old, value) => old.WithProjectReferences(projectId, value), 1364var solution2 = solution.WithProjectReferences(projectId, projectRefs); 1367Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectReferences(null!, new[] { projectRef })); 1368Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(ProjectId.CreateNewId(), new[] { projectRef })); 1371Assert.Throws<InvalidOperationException>(() => solution2.WithProjectReferences(projectId2, new[] { new ProjectReference(projectId) })); 1372Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(projectId, new[] { new ProjectReference(projectId) })); 1384var newSolution1 = solution.WithProjectReferences(projectId, projectRefs); 1445solution = solution.WithProjectReferences(projectId, new[] { projectRef2, externalProjectRef }); 1485.WithProjectReferences(submissionId2, new[] { new ProjectReference(submissionId1) }); 1489_ = solution.WithProjectReferences(submissionId3, new[] { new ProjectReference(submissionId1) }); 1493_ = solution.WithProjectReferences(submissionId3, new[] { new ProjectReference(projectId0) }); 1497Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(submissionId1, new[] { new ProjectReference(submissionId2), new ProjectReference(submissionId3) })); 1501Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(projectId0, new[] { new ProjectReference(submissionId1) }));