105 instantiations of ProjectReference
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (8)
Microsoft.CodeAnalysis.EditorFeatures (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.Features (2)
Microsoft.CodeAnalysis.Workspaces (4)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Microsoft.CodeAnalysis.Workspaces.UnitTests (67)
SolutionTests\SolutionTests.cs (52)
1161var projectReference = new ProjectReference(projectId2);
1918var projectRef = new ProjectReference(projectId2);
1927new ProjectReference(projectId2),
1928new ProjectReference(projectId2, ImmutableArray.Create("alias")),
1929new ProjectReference(projectId2, embedInteropTypes: true));
1938Assert.Throws<InvalidOperationException>(() => solution2.WithProjectReferences(projectId2, [new ProjectReference(projectId)]));
1939Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(projectId, [new ProjectReference(projectId)]));
1948var externalProjectRef = new ProjectReference(ProjectId.CreateNewId());
1971var projectRef2 = new ProjectReference(projectId2);
1972var projectRef3 = new ProjectReference(projectId3);
1973var externalProjectRef = new ProjectReference(ProjectId.CreateNewId());
1990Assert.Throws<ArgumentException>("projectReferences[1]", () => solution.AddProjectReferences(projectId, [new ProjectReference(projectId2), new ProjectReference(projectId2)]));
1997Assert.Throws<InvalidOperationException>(() => solution3.AddProjectReferences(projectId, [new ProjectReference(projectId)]));
2009var projectRef2 = new ProjectReference(projectId2);
2010var externalProjectRef = new ProjectReference(ProjectId.CreateNewId());
2029Assert.Throws<ArgumentException>("projectReference", () => solution.RemoveProjectReference(projectId, new ProjectReference(ProjectId.CreateNewId())));
2051.AddProjectReference(submissionId2, new ProjectReference(submissionId1))
2052.WithProjectReferences(submissionId2, [new ProjectReference(submissionId1)]);
2055_ = solution.AddProjectReferences(submissionId3, [new ProjectReference(submissionId1)]);
2056_ = solution.WithProjectReferences(submissionId3, [new ProjectReference(submissionId1)]);
2059_ = solution.AddProjectReferences(submissionId3, [new ProjectReference(projectId0)]);
2060_ = solution.WithProjectReferences(submissionId3, [new ProjectReference(projectId0)]);
2063Assert.Throws<InvalidOperationException>(() => solution.AddProjectReferences(submissionId2, [new ProjectReference(submissionId3)]));
2064Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(submissionId1, [new ProjectReference(submissionId2), new ProjectReference(submissionId3)]));
2067Assert.Throws<InvalidOperationException>(() => solution.AddProjectReferences(projectId0, [new ProjectReference(submissionId1)]));
2068Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(projectId0, [new ProjectReference(submissionId1)]));
2808.AddProjectReference(pm2, new ProjectReference(pm1))
2827.AddProjectReference(pm2, new ProjectReference(pm1))
2930solution = solution.AddProjectReference(projectIds[i], new ProjectReference(projectIds[i - 1]));
3082.AddProjectReference(pid2, new ProjectReference(pid));
3108.AddProjectReference(pid2, new ProjectReference(pid));
3968.AddProjectReference(pid3, new ProjectReference(pid1))
3969.AddProjectReference(pid3, new ProjectReference(pid2));
4032projectReferences: [new ProjectReference(project1.Id)]));
4062projectReferences: [new ProjectReference(project1.Id)]));
4234projectReferences: [new ProjectReference(project1.Id)]));
4988projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, projectReferences: [new ProjectReference(projectId2)]));
5017projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp, projectReferences: [new ProjectReference(projectId1)]));
5072solution = solution.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, projectReferences: [new ProjectReference(projectId2)]));
5104projectReferences: [new ProjectReference(projectId2), new ProjectReference(projectId3)]));
5161projectReferences: [new ProjectReference(projectId2), new ProjectReference(projectId3)]));
5348projectReferences: [new ProjectReference(csBrokenProject.Id), new ProjectReference(vbNormalProject.Id)]));
5358projectReferences: [new ProjectReference(vbNormalProject.Id)]));
5368projectReferences: [new ProjectReference(dependsOnBrokenProject.Id)]));
5378projectReferences: [new ProjectReference(dependsOnVbNormalProject.Id)]));
5647project2 = project2.AddProjectReference(new(project1.Id));
5677project2 = project2.AddProjectReference(new(project1.Id));
Microsoft.ML.CodeAnalyzer.Tests (1)
Microsoft.VisualStudio.LanguageServices (2)
Roslyn.VisualStudio.Next.UnitTests (15)
155 references to ProjectReference
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures (4)
Microsoft.CodeAnalysis.Features (3)
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.Workspaces (81)
Workspace\ProjectSystem\ProjectSystemProject.cs (13)
53private readonly List<ProjectReference> _projectReferencesAddedInBatch = [];
54private readonly List<ProjectReference> _projectReferencesRemovedInBatch = [];
676projectUpdateState = TryRemoveConvertedProjectReference_NoLock(projectId, path, properties, projectUpdateState, out var projectReference);
699var projectReferencesCreated = new List<ProjectReference>();
704projectId, path, properties, projectUpdateState, solutionChanges.Solution, out var projectReference);
730List<ProjectReference> projectReferencesRemovedInBatch,
731List<ProjectReference> projectReferencesAddedInBatch)
738foreach (var projectReference in projectReferencesRemovedInBatch)
1265public void AddProjectReference(ProjectReference projectReference)
1282public bool ContainsProjectReference(ProjectReference projectReference)
1293private bool ContainsProjectReference_NoLock(ProjectReference projectReference)
1306public IReadOnlyList<ProjectReference> GetProjectReferences()
1327public void RemoveProjectReference(ProjectReference projectReference)
Workspace\Solution\SolutionCompilationState.cs (5)
660ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences)
669public SolutionCompilationState RemoveProjectReference(ProjectId projectId, ProjectReference projectReference)
679ProjectId projectId, IReadOnlyList<ProjectReference> projectReferences)
1215ICompilationTracker tracker, ProjectState fromProject, ProjectReference projectReference, bool includeCrossLanguage, CancellationToken cancellationToken)
1249ProjectReference projectReference, ProjectState fromProject, bool includeCrossLanguage, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.MSBuild (15)
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()
247var newProjectReference = CreateProjectReference(from: id, to: unknownProjectId, aliases);
308var newProjectReference = CreateProjectReference(from: id, to: projectReferenceInfo.Id, aliases);
369private ProjectReference CreateProjectReference(ProjectId from, ProjectId to, ImmutableArray<string> aliases)
371var newReference = new ProjectReference(to, aliases);
405var newProjectReference = CreateProjectReference(from: id, to: projectReferenceId, aliases);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (5)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (6)
Microsoft.CodeAnalysis.Workspaces.UnitTests (31)
Microsoft.VisualStudio.LanguageServices (4)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Roslyn.VisualStudio.Next.UnitTests (1)