67 references to MetadataReferences
Microsoft.AspNetCore.App.Analyzers.Test (2)
Infrastructure\WellKnownTypesTests.cs (1)
64Stream assemblyStream = GetInMemoryAssemblyStreamForCode(referenceSource, assemblyName, project.MetadataReferences.ToArray());
TestDiagnosticAnalyzer.cs (1)
157if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
CodeActions\PreviewTests.cs (2)
76var removedReference = _oldDocument.Project.MetadataReferences[_oldDocument.Project.MetadataReferences.Count - 1];
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (1)
273.AddReferences(project.MetadataReferences);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
FindSymbols\SymbolTreeInfoTests.cs (4)
24var reference1 = (PortableExecutableReference)project.MetadataReferences.First(); 45var reference1 = (PortableExecutableReference)project.MetadataReferences.First(); 68var reference1 = (PortableExecutableReference)project.MetadataReferences.First(); 90var reference1 = (PortableExecutableReference)project.MetadataReferences.First();
MetadataAsSource\MetadataAsSourceTests.cs (2)
1926.WithMetadataReferences(context.DefaultProject.MetadataReferences) 1940.WithMetadataReferences(context.DefaultProject.MetadataReferences)
Preview\PreviewWorkspaceTests.cs (3)
76Assert.Equal(1, previewWorkspace.CurrentSolution.Projects.First().MetadataReferences.Count); 85.RemoveMetadataReference(previewWorkspace.CurrentSolution.Projects.First().MetadataReferences[0]) 89Assert.Equal(0, previewWorkspace.CurrentSolution.Projects.First().MetadataReferences.Count);
Microsoft.CodeAnalysis.Features (10)
AddImport\AbstractAddImportFeatureService.cs (3)
146var referenceToCompilation = new ConcurrentDictionary<PortableExecutableReference, Compilation>(concurrencyLevel: 2, capacity: project.Solution.Projects.Sum(p => p.MetadataReferences.Count)); 273seenReferences.AddAll(project.MetadataReferences.OfType<PortableExecutableReference>()); 334foreach (var reference in p.MetadataReferences)
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (1)
99_newProject.MetadataReferences.Concat(reference));
AddImport\SymbolReferenceFinder_PackageAssemblySearch.cs (1)
182foreach (var reference in project.MetadataReferences)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
106foreach (var peReference in currentProject.MetadataReferences.OfType<PortableExecutableReference>())
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (1)
151=> project.MetadataReferences.OfType<PortableExecutableReference>().ToImmutableArray();
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
66foreach (var reference in project.MetadataReferences)
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
39this.References = [.. sourceProject.MetadataReferences];
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
335metadataReferences: project.MetadataReferences.ToImmutableArray()); // TODO: Read references from PDB info: https://github.com/dotnet/roslyn/issues/55834
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
LineCommit\CommitBufferManager.vb (1)
318For Each reference In project.MetadataReferences
Microsoft.CodeAnalysis.Workspaces (14)
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (1)
115foreach (var peReference in project.MetadataReferences.OfType<PortableExecutableReference>())
FindSymbols\FindReferences\DependentProjectsFinder.cs (2)
333foreach (var reference in project.MetadataReferences) 406.AddReferences(project.MetadataReferences);
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
88var referencingProjects = new HashSet<ProjectId>(solution.Projects.Where(p => p.MetadataReferences.Contains(reference)).Select(p => p.Id)); 152foreach (var reference in project.MetadataReferences.OfType<PortableExecutableReference>().Distinct())
Workspace\ProjectSystem\ProjectSystemProject.cs (2)
685var metadataReference = projectBeforeMutation.MetadataReferences 1379originalMetadataReferences = project.MetadataReferences;
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
822getReferences: static project => project.MetadataReferences.OfType<PortableExecutableReference>(),
Workspace\Solution\ProjectChanges.cs (4)
50var oldMetadata = new HashSet<MetadataReference>(OldProject.MetadataReferences); 51foreach (var metadata in NewProject.MetadataReferences) 62var newMetadata = new HashSet<MetadataReference>(NewProject.MetadataReferences); 63foreach (var metadata in OldProject.MetadataReferences)
Workspace\Workspace.cs (2)
1470foreach (var meta in project.MetadataReferences) 2036project.MetadataReferences,
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildWorkspace.cs (1)
633if (!project.MetadataReferences.Contains(metadataReference))
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (12)
VisualStudioMSBuildWorkspaceTests.cs (12)
78var references = vbProject.MetadataReferences.ToList(); 183=> project.MetadataReferences 188=> project.MetadataReferences 789var refs = project.MetadataReferences.ToList(); 1328var metaRefs = project.MetadataReferences.ToList(); 1351Assert.Contains(project.MetadataReferences, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll")); 1395var metaRefs = project.MetadataReferences.ToList(); 1416var metaRefs = project.MetadataReferences.ToList(); 1439Assert.Contains(vbProject.MetadataReferences, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll")); 1447Assert.DoesNotContain(vbProject.MetadataReferences, r => r.Properties.Aliases.Contains("CSharpProject")); 3174Assert.DoesNotContain(project.MetadataReferences, mr => mr is UnresolvedMetadataReference); 3218project.MetadataReferences.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)).OrderBy(StringComparer.Ordinal));
Microsoft.CodeAnalysis.Workspaces.UnitTests (5)
SolutionTests\SolutionTests.cs (5)
2081opt => opt.GetProject(projectId)!.MetadataReferences, 2103AssertEx.Equal((MetadataReference[])[metadataRef1, metadataRef2], solution3.GetProject(projectId)!.MetadataReferences); 2126AssertEx.Equal((MetadataReference[])[metadataRef2], solution2.GetProject(projectId)!.MetadataReferences); 2129Assert.Empty(solution3.GetProject(projectId)!.MetadataReferences); 2851foreach (var meta in project.MetadataReferences)
Microsoft.ML.CodeAnalyzer.Tests (1)
Code\BestFriendTest.cs (1)
71projectA = projectA.WithMetadataReferences(solution.GetProject(projectId).MetadataReferences);
Microsoft.VisualStudio.LanguageServices (6)
Library\ObjectBrowser\AbstractListItemFactory.cs (3)
492foreach (var reference in project.MetadataReferences) 520foreach (var reference in project.MetadataReferences) 616foreach (var reference in project.MetadataReferences)
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
35var reference = fromProject.MetadataReferences.OfType<PortableExecutableReference>()
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
34var reference = fromProject.MetadataReferences.OfType<PortableExecutableReference>()
Snippets\SnippetExpansionClient.cs (1)
1086var existingReferenceNames = originalProject.MetadataReferences.Select(r => Path.GetFileNameWithoutExtension(r.Display));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Interactive\Commands\ResetInteractiveTests.cs (1)
142var metadataReferences = project.MetadataReferences.Select(r => r.Display);
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
ProjectSystemShim\Framework\ExtensionMethods.vb (1)
12Return project.MetadataReferences.Cast(Of PortableExecutableReference).Any(Function(vsReference) String.Equals(vsReference.FilePath, path, StringComparison.OrdinalIgnoreCase))
Mvc.Api.Analyzers.Test (1)
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (1)
37if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))