105 references to 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)
324solution = 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)
1479var 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()));