103 instantiations of ProjectReference
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (10)
Microsoft.CodeAnalysis.EditorFeatures (1)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Microsoft.CodeAnalysis.Features (3)
Microsoft.CodeAnalysis.Workspaces (4)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (57)
SolutionTests\SolutionTests.cs (42)
1351var projectRef = new ProjectReference(projectId2);
1360new ProjectReference(projectId2),
1361new ProjectReference(projectId2, ImmutableArray.Create("alias")),
1362new ProjectReference(projectId2, embedInteropTypes: true));
1371Assert.Throws<InvalidOperationException>(() => solution2.WithProjectReferences(projectId2, new[] { new ProjectReference(projectId) }));
1372Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(projectId, new[] { new ProjectReference(projectId) }));
1381var externalProjectRef = new ProjectReference(ProjectId.CreateNewId());
1404var projectRef2 = new ProjectReference(projectId2);
1405var projectRef3 = new ProjectReference(projectId3);
1406var externalProjectRef = new ProjectReference(ProjectId.CreateNewId());
1423Assert.Throws<ArgumentException>("projectReferences[1]", () => solution.AddProjectReferences(projectId, new[] { new ProjectReference(projectId2), new ProjectReference(projectId2) }));
1430Assert.Throws<InvalidOperationException>(() => solution3.AddProjectReferences(projectId, new[] { new ProjectReference(projectId) }));
1442var projectRef2 = new ProjectReference(projectId2);
1443var externalProjectRef = new ProjectReference(ProjectId.CreateNewId());
1462Assert.Throws<ArgumentException>("projectReference", () => solution.RemoveProjectReference(projectId, new ProjectReference(ProjectId.CreateNewId())));
1484.AddProjectReference(submissionId2, new ProjectReference(submissionId1))
1485.WithProjectReferences(submissionId2, new[] { new ProjectReference(submissionId1) });
1488_ = solution.AddProjectReferences(submissionId3, new[] { new ProjectReference(submissionId1) });
1489_ = solution.WithProjectReferences(submissionId3, new[] { new ProjectReference(submissionId1) });
1492_ = solution.AddProjectReferences(submissionId3, new[] { new ProjectReference(projectId0) });
1493_ = solution.WithProjectReferences(submissionId3, new[] { new ProjectReference(projectId0) });
1496Assert.Throws<InvalidOperationException>(() => solution.AddProjectReferences(submissionId2, new[] { new ProjectReference(submissionId3) }));
1497Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(submissionId1, new[] { new ProjectReference(submissionId2), new ProjectReference(submissionId3) }));
1500Assert.Throws<InvalidOperationException>(() => solution.AddProjectReferences(projectId0, new[] { new ProjectReference(submissionId1) }));
1501Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(projectId0, new[] { new ProjectReference(submissionId1) }));
2161.AddProjectReference(pm2, new ProjectReference(pm1))
2180.AddProjectReference(pm2, new ProjectReference(pm1))
2282solution = solution.AddProjectReference(projectIds[i], new ProjectReference(projectIds[i - 1]));
2434.AddProjectReference(pid2, new ProjectReference(pid));
2460.AddProjectReference(pid2, new ProjectReference(pid));
3329.AddProjectReference(pid3, new ProjectReference(pid1))
3330.AddProjectReference(pid3, new ProjectReference(pid2));
3393projectReferences: new[] { new ProjectReference(project1.Id) }));
3423projectReferences: new[] { new ProjectReference(project1.Id) }));
3567projectReferences: new[] { new ProjectReference(project1.Id) }));
4219projectReferences: new[] { new ProjectReference(csBrokenProject.Id), new ProjectReference(vbNormalProject.Id) }));
4229projectReferences: new[] { new ProjectReference(vbNormalProject.Id) }));
4239projectReferences: new[] { new ProjectReference(dependsOnBrokenProject.Id) }));
4249projectReferences: new[] { new ProjectReference(dependsOnVbNormalProject.Id) }));
Microsoft.VisualStudio.LanguageServices (2)
Microsoft.VisualStudio.LanguageServices.CSharp (3)
Microsoft.VisualStudio.LanguageServices.Implementation (1)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
Roslyn.VisualStudio.Next.UnitTests (12)
175 references to ProjectReference
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures (4)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (5)
Microsoft.CodeAnalysis.Features (3)
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.Workspaces (92)
Workspace\Solution\SolutionState.cs (8)
453foreach (var projectReference in newState.Value.ProjectReferences)
827public SolutionState AddProjectReferences(ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences)
848public SolutionState RemoveProjectReference(ProjectId projectId, ProjectReference projectReference)
888public SolutionState WithProjectReferences(ProjectId projectId, IReadOnlyList<ProjectReference> projectReferences)
1960public Task<MetadataReference?> GetMetadataReferenceAsync(ProjectReference projectReference, ProjectState fromProject, CancellationToken cancellationToken)
1982ICompilationTracker tracker, ProjectState fromProject, ProjectReference projectReference, CancellationToken cancellationToken)
2014ProjectReference projectReference,
2049internal bool ContainsProjectReference(ProjectId projectId, ProjectReference projectReference)
Microsoft.CodeAnalysis.Workspaces.MSBuild (16)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (12)
23public ImmutableHashSet<ProjectReference> ProjectReferences { get; }
26public ResolvedReferences(ImmutableHashSet<ProjectReference> projectReferences, ImmutableArray<MetadataReference> metadataReferences)
56private readonly ImmutableHashSet<ProjectReference>.Builder _projectReferences;
63_projectReferences = ImmutableHashSet.CreateBuilder<ProjectReference>();
92public void AddProjectReference(ProjectReference projectReference)
97public void SwapMetadataReferenceForProjectReference(ProjectReference projectReference, params string?[] possibleMetadataReferencePaths)
179private ImmutableHashSet<ProjectReference> GetProjectReferences()
238var newProjectReference = CreateProjectReference(from: id, to: unknownProjectId, aliases);
299var newProjectReference = CreateProjectReference(from: id, to: projectReferenceInfo.Id, aliases);
359private ProjectReference CreateProjectReference(ProjectId from, ProjectId to, ImmutableArray<string> aliases)
361var newReference = new ProjectReference(to, aliases);
395var newProjectReference = CreateProjectReference(from: id, to: projectReferenceId, aliases);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (5)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (34)
SolutionTests\ProjectInfoTests.cs (9)
48projectReferences: new ProjectReference[] { null }));
50var projectReference = new ProjectReference(ProjectId.CreateNewId());
111var projectReference = new ProjectReference(ProjectId.CreateNewId());
114Assert.Same(projectReference, ((ImmutableArray<ProjectReference>)info1.ProjectReferences).Single());
117Assert.True(((ImmutableArray<ProjectReference>)info2.ProjectReferences).IsEmpty);
119var info3 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", projectReferences: new ProjectReference[0]);
120Assert.True(((ImmutableArray<ProjectReference>)info3.ProjectReferences).IsEmpty);
122var info4 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", projectReferences: ImmutableArray<ProjectReference>.Empty);
123Assert.True(((ImmutableArray<ProjectReference>)info4.ProjectReferences).IsEmpty);
Microsoft.VisualStudio.LanguageServices (4)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.Implementation (1)
Roslyn.VisualStudio.Next.UnitTests (3)