105 instantiations of ProjectReference
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (8)
Workspaces\WorkspaceTests_EditorFeatures.cs (8)
267Assert.Throws<ArgumentException>(() => workspace.OnProjectReferenceAdded(project1.Id, new ProjectReference(project2.Id))); 282var reference = new ProjectReference(project2.Id); 304workspace.OnProjectReferenceAdded(project1.Id, new ProjectReference(project2.Id)); 306Assert.Throws<ArgumentException>(() => workspace.OnProjectReferenceAdded(project1.Id, new ProjectReference(project2.Id))); 321workspace.OnProjectReferenceAdded(project1.Id, new ProjectReference(project2.Id)); 322workspace.OnProjectReferenceRemoved(project1.Id, new ProjectReference(project2.Id)); 343workspace.OnProjectReferenceAdded(project1.Id, new ProjectReference(project2.Id)); 345Assert.Throws<ArgumentException>(() => workspace.OnProjectReferenceAdded(project2.Id, new ProjectReference(project1.Id)));
Microsoft.CodeAnalysis.EditorFeatures (1)
Interactive\InteractiveSession.cs (1)
309solution = solution.AddProjectReference(newSubmissionProjectId, new ProjectReference(previousSubmissionProjectId));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
SymbolFinder\DependentTypeFinderTests.cs (1)
39projectReferences: projectReferences.Select(p => new ProjectReference(p)));
Microsoft.CodeAnalysis.Features (2)
AddMissingReference\AddMissingReferenceCodeAction.cs (1)
63new ProjectReference(candidateProjectId), missingAssemblyIdentity);
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
379updatedSolution = updatedSolution.AddProjectReference(triggeringProject.Id, new ProjectReference(projectToBeUpdated.Id));
Microsoft.CodeAnalysis.Workspaces (4)
Serialization\SerializerService_Asset.cs (1)
82return new ProjectReference(projectId, aliases.ToImmutableArrayOrEmpty(), embedInteropTypes);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (2)
566var projectReference = new ProjectReference(projectIdToReference, peReference.Properties.Aliases, peReference.Properties.EmbedInteropTypes); 706projectReference = new ProjectReference(
Workspace\Workspace.cs (1)
1437var newProjRef = new ProjectReference(matchingProjectId, pemeta.Properties.Aliases, pemeta.Properties.EmbedInteropTypes);
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (1)
371var newReference = new ProjectReference(to, aliases);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Workspaces\TestHostProject`1.cs (1)
151ProjectReferences = projectReferences != null ? projectReferences.Select(p => new ProjectReference(p.Id)) : SpecializedCollections.EmptyEnumerable<ProjectReference>();
Workspaces\TestWorkspace`1.cs (2)
693OnProjectReferenceAdded(fromProject.Id, new ProjectReference(toProject.Id, aliases.Any() ? aliases : default)); 708OnProjectReferenceAdded(submissions[i].Id, new ProjectReference(submissions[j].Id));
Microsoft.CodeAnalysis.Workspaces.UnitTests (67)
FindAllDeclarationsTests.cs (1)
179.AddProjectReference(submission1Id, new ProjectReference(submission0Id))
FindReferencesTests.cs (2)
39projectReferences: projectReferences.Select(p => new ProjectReference(p))); 55projectReferences: projectReferences.Select(p => new ProjectReference(p)));
SolutionTests\ProjectDependencyGraphTests.cs (3)
228dependencyGraph = dependencyGraph.WithAdditionalProjectReferences(projectAId, [new ProjectReference(projectBId)]); 247projectReferences: [new ProjectReference(projectBId)]); 724references.Add(new ProjectReference(solution.GetProjectsByName(targetProject).Single().Id));
SolutionTests\ProjectInfoTests.cs (3)
52var projectReference = new ProjectReference(ProjectId.CreateNewId()); 113var projectReference = new ProjectReference(ProjectId.CreateNewId()); 205SolutionTestHelpers.TestListProperty(instance, (old, value) => old.WithProjectReferences(value), opt => opt.ProjectReferences, new ProjectReference(projectId), allowDuplicates: false);
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));
SolutionTests\SolutionWithSourceGeneratorTests.cs (2)
427.AddProjectReference(projectIdWithReference, new ProjectReference(projectIdWithGenerator)); 665new ProjectReference(projectIdWithGenerator)).Solution;
WorkspaceTests\AdhocWorkspaceTests.cs (1)
124projectReferences: [new ProjectReference(id1)]);
WorkspaceTests\WorkspaceReferenceTests.cs (3)
66projectReferences: ImmutableArray.Create<ProjectReference>(new ProjectReference(referenceInfo.Id)), 106projectReferences: ImmutableArray.Create<ProjectReference>(new ProjectReference(referenceInfo.Id)), 146projectReferences: ImmutableArray.Create<ProjectReference>(new ProjectReference(referenceInfo.Id)),
Microsoft.ML.CodeAnalyzer.Tests (1)
Code\BestFriendTest.cs (1)
74solution = solution.AddProjectReference(projectId, new ProjectReference(projectA.Id));
Microsoft.VisualStudio.LanguageServices (2)
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (1)
36var updatedProject = fromProject.AddProjectReference(new ProjectReference(_toProjectId));
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (1)
36var updatedProject = fromProject.RemoveProjectReference(new ProjectReference(_toProjectId));
Roslyn.VisualStudio.Next.UnitTests (15)
Services\ServiceHubServicesTests.cs (7)
297return solution.AddProjectReference(projectId1, new ProjectReference(projectId2)); 316solution = solution.RemoveProjectReference(projectId1, new ProjectReference(projectId2)); 317return solution.AddProjectReference(projectId2, new ProjectReference(projectId1)); 330solution = solution.RemoveProjectReference(projectId2, new ProjectReference(projectId1)); 331return solution.AddProjectReference(projectId1, new ProjectReference(projectId2)); 358projectReferences: [new ProjectReference(p2)]), 1749solution = current.AddProjectReference(new ProjectReference(p2pReferences[i])).Solution;
Services\SolutionServiceTests.cs (8)
636solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 669solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 710solution = project3.Solution.AddProjectReference(project3.Id, new(project2.Id)) 711.AddProjectReference(project2.Id, new(project1.Id)); 750solution = project3.Solution.AddProjectReference(project3.Id, new(project2.Id)) 751.AddProjectReference(project3.Id, new(project1.Id)); 892solution = solution.GetProject(project1.Id).AddProjectReference(new ProjectReference(project2.Id)).Solution; 924project1 = project1.AddProjectReference(new ProjectReference(ProjectId.CreateNewId()));
155 references to ProjectReference
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Workspaces\WorkspaceTests_EditorFeatures.cs (1)
282var reference = new ProjectReference(project2.Id);
Microsoft.CodeAnalysis.EditorFeatures (4)
Preview\AbstractPreviewFactoryService.cs (4)
170foreach (var projectReference in projectChanges.GetAddedProjectReferences()) 177foreach (var projectReference in projectChanges.GetRemovedProjectReferences()) 237var oldProjectReference = oldProjectReferences[projectId]; 238var newProjectReference = newProjectReferences[projectId];
Microsoft.CodeAnalysis.Features (3)
AddMissingReference\AddMissingReferenceCodeAction.cs (2)
15internal sealed class AddMissingReferenceCodeAction(Project project, string title, ProjectReference? projectReferenceToAdd, AssemblyIdentity missingAssemblyIdentity) : CodeAction 18private readonly ProjectReference? _projectReferenceToAdd = projectReferenceToAdd;
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
114var allAddedProjectReferences = new HashSet<ProjectReference>();
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Host\AssetProvider.cs (1)
197tasks.Add(SynchronizeProjectAssetCollectionAsync<ProjectReference>(new(AssetPathKind.ProjectProjectReferences, projectId), static p => p.ProjectReferences));
Host\RemoteWorkspace.SolutionCreator.cs (1)
365project = project.WithProjectReferences(await _assetProvider.GetAssetsArrayAsync<ProjectReference>(
Microsoft.CodeAnalysis.Remote.Workspaces (1)
AbstractAssetProvider.cs (1)
90var projectReferencesTask = this.GetAssetsArrayAsync<ProjectReference>(new(AssetPathKind.ProjectProjectReferences, projectId), projectChecksums.ProjectReferences, cancellationToken);
Microsoft.CodeAnalysis.Workspaces (81)
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (1)
95foreach (var projectReference in project.ProjectReferences)
Serialization\SerializationExtensions.cs (1)
26ProjectReference => WellKnownSynchronizationKind.ProjectReference,
Serialization\SerializerService_Asset.cs (2)
67private static void SerializeProjectReference(ProjectReference reference, ObjectWriter writer) 74private static ProjectReference DeserializeProjectReference(ObjectReader reader, CancellationToken cancellationToken)
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\ProjectSystem\ProjectSystemProjectFactory.cs (3)
566var projectReference = new ProjectReference(projectIdToReference, peReference.Properties.Aliases, peReference.Properties.EmbedInteropTypes); 698out ProjectReference? projectReference) 736out ProjectReference? projectReference)
Workspace\ProjectSystem\ProjectSystemProjectFactory.ProjectUpdateState.cs (2)
149public record struct ProjectReferenceInformation(ImmutableArray<string> OutputPaths, ImmutableArray<(string path, ProjectReference ProjectReference)> ConvertedProjectReferences) 151internal ProjectReferenceInformation WithConvertedProjectReference(string path, ProjectReference projectReference)
Workspace\Solution\Project.cs (6)
134public IEnumerable<ProjectReference> ProjectReferences => State.ProjectReferences.Where(pr => this.Solution.ContainsProject(pr.ProjectId)); 140public IReadOnlyList<ProjectReference> AllProjectReferences => State.ProjectReferences; 612public Project AddProjectReference(ProjectReference projectReference) 619public Project AddProjectReferences(IEnumerable<ProjectReference> projectReferences) 625public Project RemoveProjectReference(ProjectReference projectReference) 632public Project WithProjectReferences(IEnumerable<ProjectReference> projectReferences)
Workspace\Solution\ProjectChanges.cs (6)
24public IEnumerable<ProjectReference> GetAddedProjectReferences() 26var oldRefs = new HashSet<ProjectReference>(OldProject.ProjectReferences); 27foreach (var reference in NewProject.ProjectReferences) 36public IEnumerable<ProjectReference> GetRemovedProjectReferences() 38var newRefs = new HashSet<ProjectReference>(NewProject.ProjectReferences); 39foreach (var reference in OldProject.ProjectReferences)
Workspace\Solution\ProjectDependencyGraph.cs (1)
131internal ProjectDependencyGraph WithProjectReferences(ProjectId projectId, IReadOnlyList<ProjectReference> projectReferences)
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
15internal ProjectDependencyGraph WithAdditionalProjectReferences(ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences)
Workspace\Solution\ProjectInfo.cs (7)
129public IReadOnlyList<ProjectReference> ProjectReferences { get; } 161IReadOnlyList<ProjectReference> projectReferences, 195IEnumerable<ProjectReference>? projectReferences, 223IEnumerable<ProjectReference>? projectReferences = null, 264IEnumerable<ProjectReference>? projectReferences = null, 289IReadOnlyList<ProjectReference>? projectReferences = null, 385public ProjectInfo WithProjectReferences(IEnumerable<ProjectReference>? projectReferences)
Workspace\Solution\ProjectReference.cs (8)
17public sealed class ProjectReference : IEquatable<ProjectReference> 41=> this.Equals(obj as ProjectReference); 43public bool Equals(ProjectReference reference) 56public static bool operator ==(ProjectReference left, ProjectReference right) 57=> EqualityComparer<ProjectReference>.Default.Equals(left, right); 59public static bool operator !=(ProjectReference left, ProjectReference right)
Workspace\Solution\ProjectState.cs (2)
670public IReadOnlyList<ProjectReference> ProjectReferences => this.ProjectInfo.ProjectReferences; 829public ProjectState WithProjectReferences(IReadOnlyList<ProjectReference> projectReferences)
Workspace\Solution\Solution.cs (9)
594public Solution AddProjectReference(ProjectId projectId, ProjectReference projectReference) 610public Solution AddProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences) 619foreach (var projectReference in collection) 640public Solution RemoveProjectReference(ProjectId projectId, ProjectReference projectReference) 671public Solution WithProjectReferences(ProjectId projectId, IEnumerable<ProjectReference>? projectReferences) 1819private void CheckCircularProjectReferences(ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences) 1821foreach (var projectReference in projectReferences) 1844private void CheckSubmissionProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences, bool ignoreExistingReferences) 1851foreach (var projectReference in projectReferences)
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)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
631void AddMetadataReference(ProjectReference projectReference, MetadataReference? metadataReference)
Workspace\Solution\SolutionState.cs (4)
726public StateChange AddProjectReferences(ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences) 747public StateChange RemoveProjectReference(ProjectId projectId, ProjectReference projectReference) 787public StateChange WithProjectReferences(ProjectId projectId, IReadOnlyList<ProjectReference> projectReferences) 1360internal bool ContainsProjectReference(ProjectId projectId, ProjectReference projectReference)
Workspace\Workspace.cs (9)
875protected internal void OnProjectReferenceAdded(ProjectId projectId, ProjectReference projectReference) 892protected internal void OnProjectReferenceRemoved(ProjectId projectId, ProjectReference projectReference) 1437var newProjRef = new ProjectReference(matchingProjectId, pemeta.Properties.Aliases, pemeta.Properties.EmbedInteropTypes); 1843foreach (var removedProjectReference in projectChanges.GetRemovedProjectReferences()) 1849foreach (var addedProjectReference in projectChanges.GetAddedProjectReferences()) 2087protected virtual void ApplyProjectReferenceAdded(ProjectId projectId, ProjectReference projectReference) 2098protected virtual void ApplyProjectReferenceRemoved(ProjectId projectId, ProjectReference projectReference) 2332protected void CheckProjectHasProjectReference(ProjectId fromProjectId, ProjectReference projectReference) 2345protected void CheckProjectDoesNotHaveProjectReference(ProjectId fromProjectId, ProjectReference projectReference)
Microsoft.CodeAnalysis.Workspaces.MSBuild (15)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
70private readonly Dictionary<ProjectId, List<ProjectReference>> _projectIdToProjectReferencesMap;
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);
MSBuild\MSBuildWorkspace.cs (2)
648protected override void ApplyProjectReferenceAdded(ProjectId projectId, ProjectReference projectReference) 663protected override void ApplyProjectReferenceRemoved(ProjectId projectId, ProjectReference projectReference)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (5)
NetCoreTests.cs (4)
126var projectReference = Assert.Single(project.ProjectReferences); 173var projectReference = Assert.Single(project.ProjectReferences); 351var projectReference = Assert.Single(project.ProjectReferences); 517var projectReference = Assert.Single(project.ProjectReferences);
VisualStudioMSBuildWorkspaceTests.cs (1)
2964var pref = project.ProjectReferences.First();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (6)
SolutionUtilities.cs (1)
99public static Tuple<Project, ProjectReference> GetSingleAddedProjectReference(Solution oldSolution, Solution newSolution)
Workspaces\TestHostProject`1.cs (3)
33public IEnumerable<ProjectReference> ProjectReferences; 116ProjectReferences = SpecializedCollections.EmptyEnumerable<ProjectReference>(); 151ProjectReferences = projectReferences != null ? projectReferences.Select(p => new ProjectReference(p.Id)) : SpecializedCollections.EmptyEnumerable<ProjectReference>();
Workspaces\TestWorkspace`1.cs (2)
279public new void OnProjectReferenceAdded(ProjectId projectId, ProjectReference projectReference) 282public new void OnProjectReferenceRemoved(ProjectId projectId, ProjectReference projectReference)
Microsoft.CodeAnalysis.Workspaces.UnitTests (31)
SolutionTests\ProjectDependencyGraphTests.cs (6)
508var aToB = a.ProjectReferences.Single(reference => reference.ProjectId == b.Id); 536var aToB = a.ProjectReferences.Single(reference => reference.ProjectId == b.Id); 566var aToB = a.ProjectReferences.Single(reference => reference.ProjectId == b.Id); 615var firstBToC = b.ProjectReferences.First(reference => reference.ProjectId == c.Id); 620var remainingBToC = b.ProjectReferences.Single(reference => reference.ProjectId == c.Id); 718var referencesByTargetProject = new Dictionary<string, List<ProjectReference>>();
SolutionTests\ProjectInfoTests.cs (6)
52var projectReference = new ProjectReference(ProjectId.CreateNewId()); 113var projectReference = new ProjectReference(ProjectId.CreateNewId()); 116Assert.Same(projectReference, ((ImmutableArray<ProjectReference>)info1.ProjectReferences).Single()); 119Assert.True(((ImmutableArray<ProjectReference>)info2.ProjectReferences).IsEmpty); 122Assert.True(((ImmutableArray<ProjectReference>)info3.ProjectReferences).IsEmpty); 125Assert.True(((ImmutableArray<ProjectReference>)info4.ProjectReferences).IsEmpty);
SolutionTests\SolutionTests.cs (16)
1161var projectReference = new ProjectReference(projectId2); 1918var projectRef = new ProjectReference(projectId2); 1926var projectRefs = (IEnumerable<ProjectReference>)ImmutableArray.Create( 1948var externalProjectRef = new ProjectReference(ProjectId.CreateNewId()); 1950var projectRefs = (IEnumerable<ProjectReference>)ImmutableArray.Create(externalProjectRef); 1971var projectRef2 = new ProjectReference(projectId2); 1972var projectRef3 = new ProjectReference(projectId3); 1973var externalProjectRef = new ProjectReference(ProjectId.CreateNewId()); 1977var solution2 = solution.AddProjectReferences(projectId, EmptyEnumerable<ProjectReference>()); 1983AssertEx.Equal((ProjectReference[])[projectRef2], solution3.GetProject(projectId)!.ProjectReferences); 1984AssertEx.Equal((ProjectReference[])[projectRef2, externalProjectRef], solution3.GetProject(projectId)!.AllProjectReferences); 2009var projectRef2 = new ProjectReference(projectId2); 2010var externalProjectRef = new ProjectReference(ProjectId.CreateNewId()); 2016AssertEx.Equal((ProjectReference[])[projectRef2], solution2.GetProject(projectId)!.AllProjectReferences); 2020AssertEx.Equal((ProjectReference[])[externalProjectRef], solution3.GetProject(projectId)!.AllProjectReferences); 2857foreach (var referenced in project.ProjectReferences)
WorkspaceTests\WorkspaceReferenceTests.cs (3)
66projectReferences: ImmutableArray.Create<ProjectReference>(new ProjectReference(referenceInfo.Id)), 106projectReferences: ImmutableArray.Create<ProjectReference>(new ProjectReference(referenceInfo.Id)), 146projectReferences: ImmutableArray.Create<ProjectReference>(new ProjectReference(referenceInfo.Id)),
Microsoft.VisualStudio.LanguageServices (4)
Preview\ReferenceChange.ProjectReferenceChange.cs (2)
15private readonly ProjectReference _reference; 18public ProjectReferenceChange(ProjectReference reference, string projectReferenceName, ProjectId projectId, string projectName, bool isAdded, PreviewEngine engine)
ProjectSystem\VisualStudioWorkspaceImpl.cs (2)
691ProjectId projectId, ProjectReference projectReference) 731ProjectId projectId, ProjectReference projectReference)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
ProjectSystemShim\CPS\CSharpReferencesTests.cs (1)
49IEnumerable<ProjectReference> GetProject3ProjectReferences()
Roslyn.VisualStudio.Next.UnitTests (1)
Remote\SerializationValidator.cs (1)
153await VerifyAssetSerializationAsync<ProjectReference>(