14 types derived from PortableExecutableReference
Microsoft.CodeAnalysis (1)
MetadataReference\MetadataImageReference.cs (1)
16internal sealed class MetadataImageReference : PortableExecutableReference
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\CompilationAPITests.cs (1)
2169private sealed class EvolvingTestReference : PortableExecutableReference
Microsoft.CodeAnalysis.InteractiveHost (1)
Interactive\Core\InteractiveHost.ShadowCopyReference.cs (1)
15private sealed class ShadowCopyReference : PortableExecutableReference
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\MetadataService.cs (1)
47private class ThrowingExecutableReference : PortableExecutableReference
Microsoft.CodeAnalysis.Test.Utilities (2)
Mocks\TestMetadataReference.cs (2)
14public class TestMetadataReference : PortableExecutableReference 55public class TestImageReference : PortableExecutableReference
Microsoft.CodeAnalysis.UnitTests (2)
MetadataReferences\MetadataReferenceTests.cs (2)
462private class MyReference : PortableExecutableReference 493private class MyReference2 : PortableExecutableReference
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Compilation\CompilationAPITests.vb (1)
2418Inherits PortableExecutableReference
Microsoft.CodeAnalysis.Workspaces (2)
Serialization\SerializedPortableExecutableReference.cs (1)
19private sealed class SerializedPortableExecutableReference : PortableExecutableReference, ISupportTemporaryStorage
Serialization\SerializerService_Reference.cs (1)
505private sealed class MissingMetadataReference : PortableExecutableReference
Microsoft.VisualStudio.LanguageServices (1)
ProjectSystem\MetadataReferences\VisualStudioPortableExecutableReference.cs (1)
31private sealed class VisualStudioPortableExecutableReference : PortableExecutableReference, ISupportTemporaryStorage
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
ReferenceManager\VisualStudioMetadataReferenceManagerTests.vb (1)
55Inherits PortableExecutableReference
VBCSCompiler (1)
src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
112internal sealed class CachingMetadataReference : PortableExecutableReference
2 instantiations of PortableExecutableReference
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Compilation\CompilationAPITests.vb (1)
2425MyBase.New(MetadataReferenceProperties.Assembly)
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
ReferenceManager\VisualStudioMetadataReferenceManagerTests.vb (1)
62MyBase.New(New MetadataReferenceProperties(), fullPath)
1221 references to PortableExecutableReference
ConfigurationSchemaGenerator (2)
ConfigSchemaGenerator.cs (2)
18var inputReference = CreateMetadataReference(inputAssembly); 45internal static PortableExecutableReference CreateMetadataReference(string path)
Microsoft.CodeAnalysis (49)
CommandLine\CommandLineArguments.cs (5)
425internal static ImmutableArray<PortableExecutableReference> ResolveMetadataReference(CommandLineReference cmdReference, MetadataReferenceResolver metadataResolver, List<DiagnosticInfo>? diagnosticsOpt, CommonMessageProvider? messageProviderOpt) 430ImmutableArray<PortableExecutableReference> references; 437var diagnostic = PortableExecutableReference.ExceptionToDiagnostic(e, messageProviderOpt!, Location.None, cmdReference.Reference, cmdReference.Properties.Kind); 439return ImmutableArray<PortableExecutableReference>.Empty; 446return ImmutableArray<PortableExecutableReference>.Empty;
CommandLine\CommonCompiler.cs (1)
209internal virtual Func<string, MetadataReferenceProperties, PortableExecutableReference> GetMetadataProvider()
CommandLine\CommonCompiler.ExistingReferencesResolver.cs (3)
44public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string? baseFilePath, MetadataReferenceProperties properties) 52var peReference = metadataReference as PortableExecutableReference;
CommandLine\CommonCompiler.LoggingMetadataFileReferenceResolver.cs (4)
17private readonly Func<string, MetadataReferenceProperties, PortableExecutableReference> _provider; 19public LoggingMetadataFileReferenceResolver(RelativePathResolver pathResolver, Func<string, MetadataReferenceProperties, PortableExecutableReference> provider, TouchedFileLogger? logger) 29public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string? baseFilePath, MetadataReferenceProperties properties) 39return ImmutableArray<PortableExecutableReference>.Empty;
Compilation\Compilation.cs (2)
672var peReference = reference as PortableExecutableReference;
Compilation\DeterministicKeyBuilder.cs (1)
292if (reference is PortableExecutableReference peReference)
MetadataReference\AssemblyMetadata.cs (1)
447public PortableExecutableReference GetReference(
MetadataReference\MetadataImageReference.cs (1)
39protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties)
MetadataReference\MetadataReference.cs (4)
119public static PortableExecutableReference CreateFromImage( 157public static PortableExecutableReference CreateFromImage( 199public static PortableExecutableReference CreateFromStream( 241public static PortableExecutableReference CreateFromFile(
MetadataReference\MetadataReferenceResolver.cs (2)
17public abstract ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string? baseFilePath, MetadataReferenceProperties properties); 31public virtual PortableExecutableReference? ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity) => null;
MetadataReference\ModuleMetadata.cs (1)
383public PortableExecutableReference GetReference(DocumentationProvider? documentation = null, string? filePath = null, string? display = null)
MetadataReference\PortableExecutableReference.cs (6)
79public new PortableExecutableReference WithAliases(IEnumerable<string> aliases) 89public new PortableExecutableReference WithAliases(ImmutableArray<string> aliases) 99public new PortableExecutableReference WithEmbedInteropTypes(bool value) 109public new PortableExecutableReference WithProperties(MetadataReferenceProperties properties) 130protected abstract PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties); 162/// Returns a copy of the <see cref="Metadata"/> object this <see cref="PortableExecutableReference"/>
PEWriter\MetadataWriter.PortablePdb.cs (1)
965if (referenceManager.GetMetadataReference(pair.AssemblySymbol) is PortableExecutableReference { FilePath: { } } portableReference)
ReferenceManager\CommonReferenceManager.Binding.cs (6)
105ref ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions, 222ref ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions, 274out PortableExecutableReference? resolvedReference)) 527ref ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions, 532[NotNullWhen(true)] out PortableExecutableReference? resolvedReference) 576PortableExecutableReference peReference,
ReferenceManager\CommonReferenceManager.Resolution.cs (7)
320var peReference = (PortableExecutableReference)boundReference; 475private Metadata? GetMetadata(PortableExecutableReference peReference, CommonMessageProvider messageProvider, Location location, DiagnosticBag diagnostics) 505newDiagnostic = PortableExecutableReference.ExceptionToDiagnostic(e, messageProvider, location, peReference.Display ?? "", peReference.Properties.Kind); 526private bool TryGetObservedMetadata(PortableExecutableReference peReference, DiagnosticBag diagnostics, out Metadata? metadata) 545internal AssemblyMetadata? GetAssemblyMetadata(PortableExecutableReference peReference, DiagnosticBag diagnostics) 868private static PortableExecutableReference? ResolveReferenceDirective(string reference, Location location, TCompilation compilation)
ReferenceManager\CommonReferenceManager.State.cs (4)
48internal abstract ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> ImplicitReferenceResolutions { get; } 132private ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?>? _lazyImplicitReferenceResolutions; 259internal override ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> ImplicitReferenceResolutions 414ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions,
Microsoft.CodeAnalysis.CSharp (5)
Symbols\ReferenceManager.cs (1)
380ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?>.Empty;
Symbols\Source\SourceAssemblySymbol.cs (2)
972var fileRef = pair.Key as PortableExecutableReference;
Symbols\SymbolDistinguisher.cs (2)
182PortableExecutableReference metadataReference = compilation.GetMetadataReference(containingAssembly) as PortableExecutableReference;
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
12096var minSystemCollectionsImmutableRef = MetadataReference.CreateFromImage(minSystemCollectionsImmutableImage); 12108var minCodeAnalysisRef = MetadataReference.CreateFromImage(minCodeAnalysisImage);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
CodeActions\AddUsing\AddUsingTests.cs (1)
2050var resolver = new TestMetadataReferenceResolver(assemblyNames: new Dictionary<string, PortableExecutableReference>()
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (2)
3189var reference = MetadataReference.CreateFromImage(compilation.EmitToArray()); 3242var libRef = MetadataReference.CreateFromImage(libComp.EmitToArray());
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (51)
CodeGen\CodeGenDynamicTests.cs (2)
298var funcRef = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.InvalidFuncDelegateName.AsImmutableOrNull()); 11849var ilRef = MetadataReference.CreateFromImage(TestResources.MetadataTests.Interop.IndexerWithByRefParam.AsImmutableOrNull());
CodeGen\CodeGenExplicitImplementationTests.cs (3)
251var asm01 = TestReferences.MetadataTests.InterfaceAndClass.VBInterfaces01; 252var asm02 = TestReferences.MetadataTests.InterfaceAndClass.VBClasses01; 368var asm01 = TestReferences.MetadataTests.InterfaceAndClass.VBInterfaces01;
CodeGen\CodeGenFunctionPointersTests.cs (1)
4071var invalidAttributeReference = MetadataReference.CreateFromStream(peStream);
CodeGen\CodeGenImplicitlyTypeArraysTests.cs (1)
284var mscorlib17626 = MetadataReference.CreateFromImage(Net461.Resources.mscorlib);
CodeGen\CodeGenInterfaceImplementation.cs (1)
356var asmRef = TestReferences.MetadataTests.InterfaceAndClass.VBInterfaces01;
CodeGen\CodeGenMscorlib.cs (6)
248var reference1 = MetadataReference.CreateFromStream(compilation1.EmitToStream()); 282var reference1 = MetadataReference.CreateFromStream(compilation1.EmitToStream()); 319var reference1 = MetadataReference.CreateFromStream(compilation1.EmitToStream()); 357var reference1 = MetadataReference.CreateFromStream(compilation1.EmitToStream()); 416var reference1 = MetadataReference.CreateFromStream(compilation1.EmitToStream()); 478var reference1 = MetadataReference.CreateFromStream(compilation1.EmitToStream());
CodeGen\CodeGenOverridingAndHiding.cs (13)
2825var asm01 = TestReferences.MetadataTests.InterfaceAndClass.VBInterfaces01; 2826var asm02 = TestReferences.MetadataTests.InterfaceAndClass.VBClasses01; 2918var asm01 = TestReferences.MetadataTests.InterfaceAndClass.VBInterfaces01; 2919var asm02 = TestReferences.MetadataTests.InterfaceAndClass.VBClasses01; 2979var asm01 = TestReferences.MetadataTests.InterfaceAndClass.CSInterfaces01; 2980var asm02 = TestReferences.MetadataTests.InterfaceAndClass.CSClasses01; 3156var asm01 = TestReferences.MetadataTests.InterfaceAndClass.CSInterfaces01; 3157var asm02 = TestReferences.MetadataTests.InterfaceAndClass.CSClasses01; 3216var asm01 = TestReferences.MetadataTests.InterfaceAndClass.VBInterfaces01; 3217var asm02 = TestReferences.MetadataTests.InterfaceAndClass.VBClasses02; 3368var asm01 = TestReferences.MetadataTests.InterfaceAndClass.VBInterfaces01; 3369var asm02 = TestReferences.MetadataTests.InterfaceAndClass.VBClasses01; 3473var asmfile = TestReferences.MetadataTests.InterfaceAndClass.VBInterfaces01;
CodeGen\CodeGenTests.cs (1)
15134var testReference = AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.BadDefaultParameterValue).GetReference();
CodeGen\CodeGenTupleTest.cs (2)
23500var libCompRef = AssemblyMetadata.CreateFromImage(libComp.EmitToArray()).GetReference(); 23899var libCompRef = AssemblyMetadata.CreateFromImage(libComp.EmitToArray()).GetReference();
CodeGen\EventTests.cs (2)
619var ilAssemblyReference = TestReferences.SymbolsTests.Events; 647var reference1 = MetadataReference.CreateFromStream(compilation1.EmitToStream());
Emit\CompilationEmitTests.cs (5)
894var metadataRef = AssemblyMetadata.CreateFromImage(stream.ToArray()).GetReference(); 1312var reference = ModuleMetadata.CreateFromImage(moduleComp.EmitToArray()).GetReference(); 2680var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 2740var libAssemblyReference = MetadataReference.CreateFromImage(dllImage.AsImmutableOrNull()); 4621var metadataRef = ModuleMetadata.CreateFromStream(comp.EmitToStream()).GetReference();
Emit\EmitCustomModifiers.cs (9)
24var mscorlibRef = Net40.References.mscorlib; 99var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 158var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 210var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 281var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 374var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 456var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 508var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll; 551var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll;
Emit\EmitMetadataTests.cs (4)
183var metadataTestLib1 = TestReferences.SymbolsTests.MDTestLib1; 184var metadataTestLib2 = TestReferences.SymbolsTests.MDTestLib2; 236var netModule1 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1).GetReference(filePath: Path.GetFullPath("netModule1.netmodule")); 237var netModule2 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule2).GetReference(filePath: Path.GetFullPath("netModule2.netmodule"));
Emit\ResourceTests.cs (1)
378var netModule1 = TestReferences.SymbolsTests.netModule.netModule1;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (13)
Attributes\AttributeTests.cs (2)
4885var ref1 = MetadataReference.CreateFromStream(metadataStream1); 4894var ref2 = MetadataReference.CreateFromStream(metadataStream2);
Attributes\AttributeTests_Assembly.cs (1)
578var hash_module = TestReferences.SymbolsTests.netModule.hash_module;
Attributes\AttributeTests_Embedded.cs (2)
107var reference = ModuleMetadata.CreateFromImage(module.EmitToArray()).GetReference(); 227var moduleRef = ModuleMetadata.CreateFromImage(module.EmitToArray()).GetReference();
Attributes\AttributeTests_Synthesized.cs (3)
1521var reference = ModuleMetadata.CreateFromImage(referenceComp.EmitToArray()).GetReference(); 1562var reference = ModuleMetadata.CreateFromImage(referenceComp.EmitToArray()).GetReference(); 1623var moduleReference = ModuleMetadata.CreateFromImage(compilation.EmitToArray()).GetReference();
Attributes\AttributeTests_WellKnownAttributes.cs (1)
6230var peReference = MetadataReference.CreateFromStream(CreateCompilation(peSource).EmitToStream());
FlowAnalysis\StructTests.cs (4)
235var metadataReference = MetadataReference.CreateFromStream(comp1.EmitToStream()); 295var metadataReference = MetadataReference.CreateFromStream(comp1.EmitToStream()); 328var metadataReference = MetadataReference.CreateFromStream(comp1.EmitToStream()); 373var metadataReference = MetadataReference.CreateFromStream(comp1.EmitToStream());
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (6)
InteractiveSessionReferencesTests.cs (6)
165files: new Dictionary<string, PortableExecutableReference> { { @"C:\dir\x.dll", (PortableExecutableReference)SystemCoreRef } })); 463var badTypeRef = MetadataReference.CreateFromImage(badTypeBytes.AsImmutableOrNull()); 570var libRef = MetadataImageReference.CreateFromImage(libImage); 646Assert.Equal(fileBase1.Path, ((PortableExecutableReference)libBaseRefAndSymbol.Key).FilePath); 704Assert.Equal(fileBase1.Path, ((PortableExecutableReference)libBaseRefAndSymbol.Key).FilePath);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (2)
InteractiveSessionReferencesTests.cs (2)
88var libDRef = MetadataReference.CreateFromFile(libDFile.Path); 133var libBRef = MetadataReference.CreateFromFile(libBFile.Path);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (43)
Semantics\AccessCheckTests.cs (10)
952var r1 = AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(filePath: @"c:\temp\a.dll", display: "R1"); 953var r2 = AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(filePath: @"c:\temp\a.dll", display: "R2"); 1088var reference1 = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 1114var reference2 = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 1161var reference1 = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 1172var reference2 = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 1198var referenceA = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 1210var referenceB = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 1240var referenceA = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 1251var referenceB = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData);
Semantics\AmbiguousOverrideTests.cs (6)
338var asm = TestReferences.SymbolsTests.CustomModifiers.ModoptTests; 361var asm = TestReferences.SymbolsTests.CustomModifiers.ModoptTests; 382var asm = TestReferences.SymbolsTests.CustomModifiers.ModoptTests; 407var asm = TestReferences.SymbolsTests.CustomModifiers.ModoptTests; 445var asm = MetadataReference.CreateFromImage(TestResources.SymbolsTests.CustomModifiers.ModoptTests.AsImmutableOrNull()); 472var asm = TestReferences.SymbolsTests.CustomModifiers.ModoptTests;
Semantics\ColorColorTests.cs (4)
1581var ref1 = MetadataReference.CreateFromStream(comp1.EmitToStream()); 1622var ref1 = MetadataReference.CreateFromStream(comp1.EmitToStream()); 1660var ref1 = MetadataReference.CreateFromStream(comp1.EmitToStream()); 1701var ref1 = MetadataReference.CreateFromStream(comp1.EmitToStream());
Semantics\ForEachTests.cs (1)
3071var reference1 = MetadataReference.CreateFromStream(compilation1.EmitToStream());
Semantics\OverloadResolutionTestBase.cs (1)
30var mscorlibRef = AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib).GetReference(display: "mscorlib");
Semantics\OverloadResolutionTests.cs (1)
6829var libRef = TestReferences.SymbolsTests.BigVisitor;
Semantics\SemanticErrorTests.cs (3)
4556var reference1 = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 7804var reference1 = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 12902var systemRef = NetFramework.System;
Semantics\StructsTests.cs (1)
374var oldMsCorLib = Net40.References.mscorlib;
Semantics\SuppressAccessibilityChecksTests.cs (2)
31var referenceA = MetadataReference.CreateFromStream(compilationA.EmitToStream()); 153var referenceA = MetadataReference.CreateFromStream(compilationA.EmitToStream());
Semantics\UseSiteErrorTests.cs (12)
935var delegatesWithoutInvokeReference = TestReferences.SymbolsTests.DelegateImplementation.DelegatesWithoutInvoke; 995var csharpAssemblyReference = TestReferences.SymbolsTests.UseSiteErrors.CSharp; 996var ilAssemblyReference = TestReferences.SymbolsTests.UseSiteErrors.IL; 1168var unavailableRef = TestReferences.SymbolsTests.UseSiteErrors.Unavailable; 1169var ilRef = TestReferences.SymbolsTests.UseSiteErrors.IL; 1182var unavailableRef = TestReferences.SymbolsTests.UseSiteErrors.Unavailable; 1183var ilRef = TestReferences.SymbolsTests.UseSiteErrors.IL; 1196var unavailableRef = TestReferences.SymbolsTests.UseSiteErrors.Unavailable; 1197var ilRef = TestReferences.SymbolsTests.UseSiteErrors.IL; 2280var unavailableAssemblyReference = TestReferences.SymbolsTests.UseSiteErrors.Unavailable; 2281var csharpAssemblyReference = TestReferences.SymbolsTests.UseSiteErrors.CSharp; 2282var ilAssemblyReference = TestReferences.SymbolsTests.UseSiteErrors.IL;
SourceGeneration\GeneratorDriverTests.cs (2)
3221PortableExecutableReference[] metadataRefs = 3250var modifiedRef = metadataRefs[0].WithAliases(new[] { "Alias " });
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (243)
BadSymbolReference.cs (4)
27var cl2 = TestReferences.SymbolsTests.MissingTypes.CL2; 28var cl3 = TestReferences.SymbolsTests.MissingTypes.CL3; 737var cl2 = TestReferences.SymbolsTests.MissingTypes.CL2; 738var cl3 = TestReferences.SymbolsTests.MissingTypes.CL3;
Compilation\CompilationAPITests.cs (22)
490var ref1 = NetFramework.mscorlib; 491var ref2 = NetFramework.System; 590new TestMetadataReferenceResolver(files: new Dictionary<string, PortableExecutableReference>() 965var ref1 = NetFramework.mscorlib; 1185var ref1 = NetFramework.mscorlib; 1186var ref2 = NetFramework.System; 1216var modRef1 = TestReferences.MetadataTests.NetModule01.ModuleCS00; 1353var modRef1 = TestReferences.MetadataTests.NetModule01.ModuleCS00; 1410var ref1 = NetFramework.mscorlib; 1411var ref2 = NetFramework.System; 1412var ref3 = NetFramework.SystemData; 1413var ref4 = NetFramework.SystemXml; 1451var ref1 = NetFramework.mscorlib; 1472var ref1 = NetFramework.mscorlib; 1473var ref2 = NetFramework.SystemXml; 1894var alias = NetFramework.System.WithAliases(new[] { "alias" }); 2192protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties) 2299var mdRef = MetadataReference.CreateFromImage(refData); 2350var metadata = NetFramework.mscorlib; 3101var moduleReference = MetadataReference.CreateFromStream(moduleStream, MetadataReferenceProperties.Module); 3120var moduleReference = MetadataReference.CreateFromStream(moduleStream, MetadataReferenceProperties.Module); 3141var moduleReference = MetadataReference.CreateFromStream(moduleStream, MetadataReferenceProperties.Assembly);
Compilation\CSharpCompilationOptionsTests.cs (1)
433public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties)
Compilation\ReferenceManagerTests.cs (55)
41var wimpl = AssemblyMetadata.CreateFromImage(TestResources.WinRt.WImpl).GetReference(display: "WImpl"); 61var v1 = AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(display: "C, V1"); 64var v2 = AssemblyMetadata.CreateFromImage(TestResources.General.C2).GetReference(display: "C, V2"); 105var v1 = MetadataReference.CreateFromImage(TestResources.General.C1); 106var v2 = MetadataReference.CreateFromImage(TestResources.General.C2); 741var r1 = AssemblyMetadata.CreateFromImage(Net461.Resources.SystemCore).GetReference(filePath: @"c:\temp\aa.dll", display: "System.Core.v4_0_30319.dll"); 742var r2 = AssemblyMetadata.CreateFromImage(Net461.Resources.SystemCore).GetReference(filePath: @"c:\temp\aa.dll", display: "System.Core.v4_0_30319.dll"); 743var r2_SysCore = r2.WithAliases(new[] { "SysCore" }); 756var r1 = AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(filePath: @"c:\temp\a.dll", display: "R1"); 757var r2 = AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(filePath: @"c:\temp\a.dll", display: "R2"); 758var rGoo = r2.WithAliases(new[] { "goo" }); 759var rBar = r2.WithAliases(new[] { "bar" }); 760var rEmbed = r1.WithEmbedInteropTypes(true); 856var r1 = MetadataReference.CreateFromFile(p1); 857var r2 = MetadataReference.CreateFromFile(p2); 858var r3 = MetadataReference.CreateFromFile(p3); 871assemblyNames: new Dictionary<string, PortableExecutableReference> { { "Lib", r3 } }, 872files: new Dictionary<string, PortableExecutableReference> { { p2, r2 }, { p3, r3 } })) 898var dr1 = compilation.GetDirectiveReference(rd1) as PortableExecutableReference; 899var dr2 = compilation.GetDirectiveReference(rd2) as PortableExecutableReference; 900var dr3 = compilation.GetDirectiveReference(rd3) as PortableExecutableReference; 927var m1 = MetadataReference.CreateFromFile(p1, new MetadataReferenceProperties(MetadataImageKind.Module)); 928var m2 = MetadataReference.CreateFromFile(p2, new MetadataReferenceProperties(MetadataImageKind.Module)); 959var ref1 = AssemblyMetadata.CreateFromImage(TestResources.General.C2).GetReference(embedInteropTypes: true, filePath: @"R:\A\MTTestLib1.dll"); 960var ref2 = AssemblyMetadata.CreateFromImage(TestResources.General.C2).GetReference(embedInteropTypes: false, filePath: @"R:\B\MTTestLib1.dll"); 996var r1 = MetadataReference.CreateFromFile(p1); 997var r2 = MetadataReference.CreateFromFile(p2); 1043var ref1 = AssemblyMetadata.CreateFromFile(exe1.Path).GetReference(aliases: ImmutableArray.Create("A1")); 1044var ref2 = AssemblyMetadata.CreateFromFile(exe2.Path).GetReference(aliases: ImmutableArray.Create("A2")); 1129var mdRefLib1 = metadataLib1.GetReference(filePath: @"C:\W1.dll"); 1130var mdRefLib2 = metadataLib2.GetReference(filePath: @"C:\W2.dll"); 1164var mdRefLib1 = metadataLib1.GetReference(filePath: @"C:\W1.dll"); 1165var mdRefLib2 = metadataLib2.GetReference(filePath: @"C:\WB.dll"); 1194var mdRefLib1 = metadataLib1.GetReference(filePath: @"C:\WB.dll"); 1195var mdRefLib2 = metadataLib2.GetReference(filePath: @"C:\WB_Version1.dll"); 1214var arSA = TestReferences.SymbolsTests.Versioning.AR_SA; 1215var enUS = TestReferences.SymbolsTests.Versioning.EN_US; 1246public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties) 1259return ImmutableArray<PortableExecutableReference>.Empty; 1305public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties) 1368files: new Dictionary<string, PortableExecutableReference>() 1394var refB = MetadataReference.CreateFromImage(b.EmitToArray()); 1404var refA2 = MetadataReference.CreateFromImage(a2.EmitToArray()); 1441var refB = MetadataReference.CreateFromImage(b.EmitToArray()); 1445var refA2 = MetadataReference.CreateFromImage(a2.EmitToArray()); 1646var oldRef = oldMetadata.GetReference(); 1733var refLib = ((MetadataImageReference)lib.EmitToImageReference()).WithEmbedInteropTypes(true); 1763var assemblyRef = assemblyMetadata.GetReference(); 2328new TestMetadataReferenceResolver(assemblyNames: new Dictionary<string, PortableExecutableReference>() 2330{ "a", (PortableExecutableReference)aRef.WithProperties(MetadataReferenceProperties.Assembly.WithRecursiveAliases(true)) } 2357new TestMetadataReferenceResolver(assemblyNames: new Dictionary<string, PortableExecutableReference>() 2359{ "a", (PortableExecutableReference)aRef.WithProperties(MetadataReferenceProperties.Assembly) }
DocumentationComments\DocumentationCommentCompilerTests.cs (2)
6932var reference = TestReferences.SymbolsTests.NoPia.GeneralPia.WithEmbedInteropTypes(false); 6942var reference = TestReferences.SymbolsTests.NoPia.GeneralPia.WithEmbedInteropTypes(true);
DocumentationComments\MethodDocumentationCommentTests.cs (2)
198var csharpAssemblyReference = TestReferences.SymbolsTests.UseSiteErrors.CSharp; 199var ilAssemblyReference = TestReferences.SymbolsTests.UseSiteErrors.IL;
SymbolDisplay\SymbolDisplayTests.cs (2)
2852var hostReference = MetadataReference.CreateFromFile(typeof(ScriptGlobals).Assembly.Location); 4564var mtref = MetadataReference.CreateFromImage(mtdata);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (3)
822var asm01 = TestReferences.MetadataTests.InterfaceAndClass.VBInterfaces01; 823var asm02 = TestReferences.MetadataTests.InterfaceAndClass.VBClasses01; 872var mtref = MetadataReference.CreateFromImage(mtdata);
Symbols\AssemblyAndNamespaceTests.cs (1)
373var aliasedCorlib = NetFramework.mscorlib.WithAliases(ImmutableArray.Create("Goo"));
Symbols\CompilationCreationTests.cs (13)
70var mdTestLib1 = TestReferences.SymbolsTests.MDTestLib1; 109var mscorlibRef = NetFramework.mscorlib; 110var cyclic2Ref = TestReferences.SymbolsTests.Cyclic.Cyclic2.dll; 128var varV1MTTestLib2Ref = TestReferences.SymbolsTests.V1.MTTestLib2.dll; 172var varV2MTTestLib3Ref = TestReferences.SymbolsTests.V2.MTTestLib3.dll; 229var varV3MTTestLib4Ref = TestReferences.SymbolsTests.V3.MTTestLib4.dll; 2614var mscorlibRef = NetFramework.mscorlib; 2615var systemCoreRef = NetFramework.SystemCore; 2616var systemRef = NetFramework.System; 2647public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties) 2666return ImmutableArray<PortableExecutableReference>.Empty; 2761public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties) 2859var r = TestReferences.SymbolsTests.Metadata.InvalidCharactersInAssemblyName;
Symbols\ConversionTests.cs (3)
24var mscorlibRef = Net40.References.mscorlib; 225var mscorlibRef = Net40.References.mscorlib; 297var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll;
Symbols\DefaultInterfaceImplementationTests.cs (2)
62577private static string BuildAssemblyExternClause(PortableExecutableReference reference) 62622var windowsRuntimeRef = CompilationExtensions.CreateWindowsRuntimeMetadataReference(TargetFramework.Net50);
Symbols\ErrorTypeSymbolTests.cs (2)
31var reference1 = MetadataReference.CreateFromImage(compilation1.EmitToArray(options: new EmitOptions(metadataOnly: true))); 45var reference2 = MetadataReference.CreateFromImage(compilation2.EmitToArray(options: new EmitOptions(metadataOnly: true)));
Symbols\ExtensionMethodTests.cs (2)
3298var reference1 = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData); 3311var reference2 = MetadataReference.CreateFromImage(compilationVerifier.EmittedAssemblyData);
Symbols\IndexedPropertyTests.cs (1)
1691var reference2 = MetadataReference.CreateFromImage(compilation2.EmittedAssemblyData);
Symbols\InterfaceImplementationTests.cs (3)
1052var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll; 1106var ilAssemblyReference = TestReferences.SymbolsTests.Interface.StaticMethodInInterface; 1124var ilAssemblyReference = TestReferences.SymbolsTests.Interface.StaticMethodInInterface;
Symbols\Metadata\MetadataTypeTests.cs (1)
347var modRef = TestReferences.MetadataTests.NetModule01.ModuleCS00;
Symbols\Metadata\PE\BaseTypeResolution.cs (5)
309var mscorlibRef = Net40.References.mscorlib; 315var localMTTestLib1Ref = TestReferences.SymbolsTests.V1.MTTestLib1.dll; 333var crossRefModule1 = TestReferences.SymbolsTests.netModule.CrossRefModule1; 334var crossRefModule2 = TestReferences.SymbolsTests.netModule.CrossRefModule2; 335var crossRefLib = TestReferences.SymbolsTests.netModule.CrossRefLib;
Symbols\Metadata\PE\DynamicTransformsTests.cs (1)
437var dll = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.InvalidDynamicAttributeArgs.AsImmutableOrNull());
Symbols\Metadata\PE\LoadingGenericTypeParameters.cs (1)
197var mdRef = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.InvalidGenericType.AsImmutableOrNull());
Symbols\Metadata\PE\LoadingMethods.cs (3)
1263var longFormRef = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.LongTypeFormInSignature); 1287var lib = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.Signatures.SignatureCycle2); 1307var lib = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.Signatures.TypeSpecInWrongPlace);
Symbols\Metadata\PE\NoPia.cs (28)
365var mscorlibRef = Net40.References.mscorlib; 366var pia1CopyLink = TestReferences.SymbolsTests.NoPia.Pia1Copy.WithEmbedInteropTypes(true); 367var pia1CopyRef = TestReferences.SymbolsTests.NoPia.Pia1Copy.WithEmbedInteropTypes(false); 687var mscorlibRef = TestReferences.SymbolsTests.MDTestLib1; 688var cyclic2Ref = TestReferences.SymbolsTests.Cyclic.Cyclic2.dll; 689var piaRef = TestReferences.SymbolsTests.NoPia.Pia1; 690var localTypes1Ref = TestReferences.SymbolsTests.NoPia.LocalTypes1; 747var mscorlibRef = Net40.References.mscorlib; 748var pia5Link = TestReferences.SymbolsTests.NoPia.Pia5.WithEmbedInteropTypes(true); 749var pia5Ref = TestReferences.SymbolsTests.NoPia.Pia5.WithEmbedInteropTypes(false); 750var library2Ref = TestReferences.SymbolsTests.NoPia.Library2.WithEmbedInteropTypes(false); 751var library2Link = TestReferences.SymbolsTests.NoPia.Library2.WithEmbedInteropTypes(true); 752var pia1Link = TestReferences.SymbolsTests.NoPia.Pia1.WithEmbedInteropTypes(true); 753var pia1Ref = TestReferences.SymbolsTests.NoPia.Pia1.WithEmbedInteropTypes(false); 872var varmscorlibRef = Net40.References.mscorlib; 873var varALink = TestReferences.SymbolsTests.NoPia.A.WithEmbedInteropTypes(true); 874var varARef = TestReferences.SymbolsTests.NoPia.A.WithEmbedInteropTypes(false); 875var varBLink = TestReferences.SymbolsTests.NoPia.B.WithEmbedInteropTypes(true); 876var varBRef = TestReferences.SymbolsTests.NoPia.B.WithEmbedInteropTypes(false); 877var varCLink = TestReferences.SymbolsTests.NoPia.C.WithEmbedInteropTypes(true); 878var varCRef = TestReferences.SymbolsTests.NoPia.C.WithEmbedInteropTypes(false); 879var varDLink = TestReferences.SymbolsTests.NoPia.D.WithEmbedInteropTypes(true); 880var varDRef = TestReferences.SymbolsTests.NoPia.D.WithEmbedInteropTypes(false); 1004var mscorlibRef = Net40.References.mscorlib; 1005var pia1CopyLink = TestReferences.SymbolsTests.NoPia.Pia1Copy.WithEmbedInteropTypes(true); 1006var pia1CopyRef = TestReferences.SymbolsTests.NoPia.Pia1Copy.WithEmbedInteropTypes(false); 1103var mscorlibRef = Net40.References.mscorlib; 1265var mscorlibRef = Net40.References.mscorlib;
Symbols\Metadata\PE\TypeForwarders.cs (6)
1464var ref1 = MetadataReference.CreateFromImage(verifier1.EmittedAssemblyData); 1538var refA = MetadataReference.CreateFromImage(bitsA); 1545var ref0 = ModuleMetadata.CreateFromImage(bits0).GetReference(); 1549var ref1 = AssemblyMetadata.Create(ModuleMetadata.CreateFromImage(bits1), ModuleMetadata.CreateFromImage(bits0)).GetReference(); 1729var ref0 = asm0.GetReference(); 1736var ref1 = assembly1.GetReference();
Symbols\OverriddenOrHiddenMembersTests.cs (1)
895var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll;
Symbols\Retargeting\NoPia.cs (17)
1254var mscorlibRef = TestReferences.SymbolsTests.MDTestLib1; 1255var cyclic2Ref = TestReferences.SymbolsTests.Cyclic.Cyclic2.dll; 1256var piaRef = TestReferences.SymbolsTests.NoPia.Pia1; 1279var mscorlibRef = TestReferences.SymbolsTests.MDTestLib1; 1280var cyclic2Ref = TestReferences.SymbolsTests.Cyclic.Cyclic2.dll; 1281var piaRef = TestReferences.SymbolsTests.NoPia.Pia1; 1305var mscorlibRef = TestReferences.SymbolsTests.MDTestLib1; 1306var cyclic2Ref = TestReferences.SymbolsTests.Cyclic.Cyclic2.dll; 2018var localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray()); 2044var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray()); 2143var localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray()); 2169var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray()); 2268var localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray()); 2294var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray()); 2406var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray()); 2476var localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray()); 2502var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray());
Symbols\Retargeting\RetargetCustomModifiers.cs (4)
26var oldMsCorLib = Net40.References.mscorlib; 27var newMsCorLib = NetFramework.mscorlib; 133var oldMsCorLib = Net40.References.mscorlib; 134var newMsCorLib = NetFramework.mscorlib;
Symbols\Source\BaseClassTests.cs (14)
69var C1 = TestReferences.SymbolsTests.CyclicInheritance.Class1; 70var C2 = TestReferences.SymbolsTests.CyclicInheritance.Class2; 986var C1 = TestReferences.SymbolsTests.CyclicInheritance.Class1; 987var C2 = TestReferences.SymbolsTests.CyclicInheritance.Class2; 1007var ClassAv1 = TestReferences.SymbolsTests.RetargetingCycle.V1.ClassA.dll; 1025var ClassAv2 = TestReferences.SymbolsTests.RetargetingCycle.V2.ClassA.dll; 1060var ClassAv1 = TestReferences.SymbolsTests.RetargetingCycle.V1.ClassA.dll; 1061var ClassBv1 = TestReferences.SymbolsTests.RetargetingCycle.V1.ClassB.netmodule; 1081var ClassAv2 = TestReferences.SymbolsTests.RetargetingCycle.V2.ClassA.dll; 1121var ClassAv2 = TestReferences.SymbolsTests.RetargetingCycle.V2.ClassA.dll; 1150var ClassAv1 = TestReferences.SymbolsTests.RetargetingCycle.V1.ClassA.dll; 1176var ClassAv2 = TestReferences.SymbolsTests.RetargetingCycle.V2.ClassA.dll; 1177var ClassBv1 = TestReferences.SymbolsTests.RetargetingCycle.V1.ClassB.netmodule; 1207var ClassAv1 = TestReferences.SymbolsTests.RetargetingCycle.V1.ClassA.dll;
Symbols\Source\CustomModifierCopyTests.cs (13)
47var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 90var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 141var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 190var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 252var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll; 317var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll; 353var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll; 407var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll; 516var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 585var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.Modifiers.dll; 688var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 721var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll; 762var ilAssemblyReference = TestReferences.SymbolsTests.CustomModifiers.CppCli.dll;
Symbols\Source\ExternAliasTests.cs (3)
216var goo1 = outputMetadata.GetReference(); 217var goo1Alias = outputMetadata.GetReference(aliases: ImmutableArray.Create("Baz")); 231var goo2 = MetadataReference.CreateFromImage(comp.EmitToArray());
Symbols\Source\PropertyTests.cs (1)
2610var mdRef = refData.GetReference(embedInteropTypes: false);
Symbols\Source\SourcePlusMetadataTests.cs (5)
190var ref2 = TestReferences.SymbolsTests.InheritIComparable; 206var ref2 = TestReferences.SymbolsTests.InheritIComparable; 234var ref2 = TestReferences.SymbolsTests.InheritIComparable; 271var C = MetadataReference.CreateFromImage(comp1.EmitToArray()); 277var B = MetadataReference.CreateFromImage(comp2.EmitToArray());
Symbols\SymbolDistinguisherTests.cs (2)
98var libRef = MetadataReference.CreateFromImage(libComp.EmitToArray(), filePath: "Metadata.dll"); 138var libRef = MetadataReference.CreateFromImage(libComp.EmitToArray(), filePath: "Metadata.dll");
Symbols\SymbolErrorTests.cs (18)
142var ref2 = TestReferences.SymbolsTests.MDTestLib2; 3935var ref1 = TestReferences.SymbolsTests.CyclicInheritance.Class1; 3936var ref2 = TestReferences.SymbolsTests.CyclicInheritance.Class2; 5488var ref1 = TestReferences.SymbolsTests.V1.MTTestLib1.dll; 5491var ref2 = TestReferences.SymbolsTests.MultiModule.Assembly; 5549var ref1 = TestReferences.DiagnosticTests.ErrTestLib11.dll; 5550var ref2 = TestReferences.DiagnosticTests.ErrTestLib02.dll; 7134var moduleRef = ModuleMetadata.CreateFromImage(ilBytes).GetReference(); 7203var moduleRef1 = ModuleMetadata.CreateFromImage(ilBytes).GetReference(); 15031var ref1 = AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1).GetReference(display: "NetModule.mod"); 15174var ref1 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.CorLibrary.NoMsCorLibRef).GetReference(display: "NoMsCorLibRef.mod"); 16168var ref1 = TestReferences.SymbolsTests.NoPia.Microsoft.VisualStudio.MissingPIAAttributes.WithEmbedInteropTypes(true); 17635var ref1 = TestReferences.SymbolsTests.Fields.CSFields.dll; 17672var ref1 = TestReferences.SymbolsTests.V1.MTTestLib1.dll; 17912var cs00 = TestReferences.MetadataTests.NetModule01.ModuleCS00; 17913var cs01 = TestReferences.MetadataTests.NetModule01.ModuleCS01; 17914var vb01 = TestReferences.MetadataTests.NetModule01.ModuleVB01; 17915var ref1 = TestReferences.MetadataTests.NetModule01.AppCS;
Symbols\TypeTests.cs (2)
894var module1Ref = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1).GetReference(display: "netModule1.netmodule"); 1437var r = MetadataReference.CreateFromImage(TestResources.SymbolsTests.Methods.CSMethods.AsImmutableOrNull());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
ThrowingMetadataReferenceResolver.cs (1)
31public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string? baseFilePath, MetadataReferenceProperties properties)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
CodeGen\WinMdEventTests.cs (1)
625var serializationRef = Net461.References.SystemRuntimeSerialization;
Metadata\WinMdDumpTest.cs (1)
476var winmd = MetadataReference.CreateFromImage(TestResources.WinRt.WinMDPrefixing.AsImmutableOrNull());
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
2556var reference = compilation.EmitToPortableExecutableReference();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
FindSymbols\SymbolTreeInfoTests.cs (8)
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\AbstractMetadataAsSourceTests.TestContext.cs (1)
118if (reference is PortableExecutableReference portableExecutable)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (7)
EEMetadataReferenceResolver.cs (3)
31public override PortableExecutableReference? ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity) 45return (PortableExecutableReference?)result.Reference; 48public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string? baseFilePath, MetadataReferenceProperties properties)
MetadataUtilities.cs (4)
132var reference = MakeAssemblyReference(metadata, modulesByName); 184var reference = MakeAssemblyReference(metadata, modulesByName); 327private static PortableExecutableReference MakeAssemblyReference(ModuleMetadata metadata, Dictionary<string, ModuleMetadata?>? modulesByName) 407private static PortableExecutableReference MakeCompileTimeWinMdAssemblyMetadata(ArrayBuilder<ModuleMetadata> runtimeModules)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (3)
CSharpFunctionResolverTests.cs (3)
412var refA = AssemblyMetadata.CreateFromImage(imageA).GetReference(); 1203var refA = AssemblyMetadata.CreateFromImage(bytesA).GetReference(); 1544var refA = AssemblyMetadata.CreateFromImage(bytesA).GetReference();
Microsoft.CodeAnalysis.Features (48)
AddImport\AbstractAddImportFeatureService.cs (21)
31: IAddImportFeatureService, IEqualityComparer<PortableExecutableReference> 35/// Cache of information about whether a <see cref="PortableExecutableReference"/> is likely contained within a 38private static readonly ConditionalWeakTable<PortableExecutableReference, StrongBox<bool>> s_isInPackagesDirectory = new(); 136var referenceToCompilation = new ConcurrentDictionary<PortableExecutableReference, Compilation>(concurrencyLevel: 2, capacity: project.Solution.Projects.Sum(p => p.MetadataReferences.Count)); 166ConcurrentDictionary<PortableExecutableReference, Compilation> referenceToCompilation, 253ConcurrentDictionary<PortableExecutableReference, Compilation> referenceToCompilation, 265var seenReferences = new HashSet<PortableExecutableReference>(comparer: this); 266seenReferences.AddAll(project.MetadataReferences.OfType<PortableExecutableReference>()); 314private static ImmutableArray<(Project, PortableExecutableReference)> GetUnreferencedMetadataReferences( 315Project project, HashSet<PortableExecutableReference> seenReferences) 317using var _ = ArrayBuilder<(Project, PortableExecutableReference)>.GetInstance(out var result); 329if (reference is PortableExecutableReference peReference && 392private static bool IsInPackagesDirectory(PortableExecutableReference reference) 398static bool ComputeIsInPackagesDirectory(PortableExecutableReference reference) 406static bool ContainsPathComponent(PortableExecutableReference reference, string pathComponent) 421private static Compilation CreateCompilation(Project project, PortableExecutableReference reference) 428bool IEqualityComparer<PortableExecutableReference>.Equals(PortableExecutableReference? x, PortableExecutableReference? y) 441int IEqualityComparer<PortableExecutableReference>.GetHashCode(PortableExecutableReference obj)
AddImport\AddImportFixData.cs (3)
75/// is the id for the <see cref="Project"/> we can find that <see cref="PortableExecutableReference"/> 82/// If we want to add a <see cref="PortableExecutableReference"/> metadata reference, this 83/// is the <see cref="PortableExecutableReference.FilePath"/> for it.
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (1)
97var reference = service.GetReference(resolvedPath, MetadataReferenceProperties.Assembly);
AddImport\CodeActions\MetadataSymbolReferenceCodeAction.cs (1)
32.OfType<PortableExecutableReference>()
AddImport\References\MetadataSymbolReference.cs (2)
25PortableExecutableReference reference) : SymbolReference(provider, symbolResult) 28private readonly PortableExecutableReference _reference = reference;
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (2)
19PortableExecutableReference metadataReference, 24private readonly PortableExecutableReference _metadataReference = metadataReference;
AddImport\SymbolReferenceFinder.cs (1)
95internal Task<ImmutableArray<SymbolReference>> FindInMetadataSymbolsAsync(IAssemblySymbol assembly, Project assemblyProject, PortableExecutableReference metadataReference, bool exact, CancellationToken cancellationToken)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (4)
106foreach (var peReference in currentProject.MetadataReferences.OfType<PortableExecutableReference>()) 156private static string? GetPEReferenceCacheKey(PortableExecutableReference peReference) 186PortableExecutableReference peReference,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (5)
63private static string? GetPEReferenceCacheKey(PortableExecutableReference peReference) 82foreach (var peReference in GetAllRelevantPeReferences(project)) 150private static ImmutableArray<PortableExecutableReference> GetAllRelevantPeReferences(Project project) 151=> project.MetadataReferences.OfType<PortableExecutableReference>().ToImmutableArray(); 199PortableExecutableReference peReference,
DesignerAttribute\DesignerAttributeDiscoveryService.cs (3)
68if (reference is PortableExecutableReference peReference) 83PortableExecutableReference peReference, 106PortableExecutableReference peReference,
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (3)
235var assemblyLocation = (metadataReference as PortableExecutableReference)?.FilePath; 380var peMetadataReference = compilation.GetMetadataReference(topLevelNamedType.ContainingAssembly) as PortableExecutableReference;
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
111if (compilation.GetMetadataReference(symbol.ContainingAssembly) is not PortableExecutableReference { FilePath: not null and var dllPath })
UnusedReferences\UnusedReferencesRemover.cs (1)
48.OfType<PortableExecutableReference>()
Microsoft.CodeAnalysis.InteractiveHost (3)
Interactive\Core\InteractiveHost.Service.cs (1)
548var metadataReferences = new List<PortableExecutableReference>();
Interactive\Core\InteractiveHost.ShadowCopyReference.cs (2)
12/// Specialize <see cref="PortableExecutableReference"/> with path being the original path of the copy. 36protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties)
Microsoft.CodeAnalysis.LanguageServer (3)
HostWorkspace\MetadataService.cs (3)
35public PortableExecutableReference GetReference(string resolvedPath, MetadataReferenceProperties properties) 39return (PortableExecutableReference)_metadataCache.GetReference(resolvedPath, properties); 66protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties)
Microsoft.CodeAnalysis.Rebuild.UnitTests (4)
DeterministicKeyBuilderTests.cs (4)
591var mscorlib = NetCoreApp.mscorlib; 621var mscorlib = NetCoreApp.mscorlib.WithAliases(new[] { "alias1", "alias2" }); 655var mscorlib = NetCoreApp.mscorlib.WithEmbedInteropTypes(embedInteropTypes); 685var reference = TestReferences.SymbolsTests.MultiModule.Assembly;
Microsoft.CodeAnalysis.Scripting (17)
Hosting\Resolvers\RuntimeMetadataReferenceResolver.cs (14)
41private readonly Func<string, MetadataReferenceProperties, PortableExecutableReference> _createFromFileFunc; 55Func<string, MetadataReferenceProperties, PortableExecutableReference>? createFromFileFunc = null) 72Func<string, MetadataReferenceProperties, PortableExecutableReference>? createFromFileFunc = null) 86Func<string, MetadataReferenceProperties, PortableExecutableReference>? createFromfileFunc = null) 97public override PortableExecutableReference? ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity) 112var result = ResolveTrustedPlatformAssembly(referenceIdentity.Name, s_resolvedMissingAssemblyReferenceProperties); 120var definitionDirectory = PathUtilities.GetDirectoryName((definition as PortableExecutableReference)?.FilePath); 137private PortableExecutableReference CreateFromFile(string filePath, MetadataReferenceProperties properties) => 140private PortableExecutableReference CreateResolvedMissingReference(string fullPath) => 143public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string? baseFilePath, MetadataReferenceProperties properties) 158var result = ResolveTrustedPlatformAssembly(PathUtilities.GetFileName(reference, includeExtension: false), properties); 187var result = ResolveTrustedPlatformAssembly(identity.Name, properties); 195return ImmutableArray<PortableExecutableReference>.Empty; 198private PortableExecutableReference? ResolveTrustedPlatformAssembly(string name, MetadataReferenceProperties properties)
ScriptBuilder.cs (1)
144var path = (referencedAssembly.Key as PortableExecutableReference)?.FilePath;
ScriptMetadataResolver.cs (2)
67public override PortableExecutableReference? ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity) 70public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string? baseFilePath, MetadataReferenceProperties properties)
Microsoft.CodeAnalysis.Scripting.TestUtilities (4)
ScriptTestBase.cs (1)
44var reference = MetadataReference.CreateFromFile(filePath, options, properties);
TestRuntimeMetadataReferenceResolver.cs (3)
25public override PortableExecutableReference ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity) 47public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties) 56return default(ImmutableArray<PortableExecutableReference>);
Microsoft.CodeAnalysis.Scripting.UnitTests (3)
ScriptOptionsTests.cs (3)
38var moduleRef = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleCS00).GetReference(); 71var assemblyRef = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.Methods.CSMethods).GetReference(); 80var moduleRef = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleCS00).GetReference();
Microsoft.CodeAnalysis.Test.Utilities (502)
AssemblyLoadTestFixture.cs (8)
194var delta1Reference = MetadataReference.CreateFromFile(Delta1); 225var delta2Reference = MetadataReference.CreateFromFile(Delta2); 247var gammaReference = MetadataReference.CreateFromFile(Gamma); 342var compilerReference = MetadataReference.CreateFromFile(typeof(Microsoft.CodeAnalysis.SyntaxNode).Assembly.Location); 361var userSystemCollectionsImmutableReference = MetadataReference.CreateFromFile(UserSystemCollectionsImmutable); 416var realSciReference = MetadataReference.CreateFromFile(typeof(ImmutableArray).Assembly.Location); 478var fakeCompilerReference = MetadataReference.CreateFromFile(fakeCompilerAssembly); 506var laterCompilerReference = MetadataReference.CreateFromFile(laterFakeCompilerAssembly);
CommonTestBase.cs (1)
166var reference = emittedMetadata.Kind == MetadataImageKind.Assembly
Compilation\CompilationExtensions.cs (2)
122public static PortableExecutableReference EmitToPortableExecutableReference( 463public static PortableExecutableReference CreateWindowsRuntimeMetadataReference(TargetFramework targetFramework = TargetFramework.NetCoreApp)
Compilation\IRuntimeEnvironment.cs (2)
103var peRef = (PortableExecutableReference)metadataReference;
Compilation\MetadataReferenceExtensions.cs (2)
24=> reference is PortableExecutableReference peReference 28public static ModuleMetadata GetManifestModuleMetadata(this PortableExecutableReference peReference)
Mocks\StdOle.cs (1)
25public static PortableExecutableReference Build(IEnumerable<MetadataReference> references)
Mocks\TestMetadataReference.cs (2)
49protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties) 90protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties)
Mocks\TestMetadataReferenceResolver.cs (11)
18private readonly Dictionary<string, PortableExecutableReference> _assemblyNames; 19private readonly Dictionary<string, PortableExecutableReference> _files; 23Dictionary<string, PortableExecutableReference> assemblyNames = null, 24Dictionary<string, PortableExecutableReference> files = null) 27_assemblyNames = assemblyNames ?? new Dictionary<string, PortableExecutableReference>(); 28_files = files ?? new Dictionary<string, PortableExecutableReference>(); 31public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties) 33Dictionary<string, PortableExecutableReference> map; 42return ImmutableArray<PortableExecutableReference>.Empty; 53return map.TryGetValue(reference, out var result) ? ImmutableArray.Create(result) : ImmutableArray<PortableExecutableReference>.Empty;
Mocks\TestMissingMetadataReferenceResolver.cs (4)
42public override PortableExecutableReference ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity) 47return _map.TryGetValue(nameAndVersion, out var reference) ? (PortableExecutableReference)reference : null; 53public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties) => default(ImmutableArray<PortableExecutableReference>);
Mocks\TestReferences.cs (441)
21private static readonly Lazy<PortableExecutableReference> s_appCS = new Lazy<PortableExecutableReference>( 24public static PortableExecutableReference AppCS => s_appCS.Value; 26private static readonly Lazy<PortableExecutableReference> s_moduleCS00 = new Lazy<PortableExecutableReference>( 29public static PortableExecutableReference ModuleCS00 => s_moduleCS00.Value; 31private static readonly Lazy<PortableExecutableReference> s_moduleCS01 = new Lazy<PortableExecutableReference>( 34public static PortableExecutableReference ModuleCS01 => s_moduleCS01.Value; 36private static readonly Lazy<PortableExecutableReference> s_moduleVB01 = new Lazy<PortableExecutableReference>( 39public static PortableExecutableReference ModuleVB01 => s_moduleVB01.Value; 44private static readonly Lazy<PortableExecutableReference> s_CSClasses01 = new Lazy<PortableExecutableReference>( 47public static PortableExecutableReference CSClasses01 => s_CSClasses01.Value; 49private static readonly Lazy<PortableExecutableReference> s_CSInterfaces01 = new Lazy<PortableExecutableReference>( 52public static PortableExecutableReference CSInterfaces01 => s_CSInterfaces01.Value; 54private static readonly Lazy<PortableExecutableReference> s_VBClasses01 = new Lazy<PortableExecutableReference>( 57public static PortableExecutableReference VBClasses01 => s_VBClasses01.Value; 59private static readonly Lazy<PortableExecutableReference> s_VBClasses02 = new Lazy<PortableExecutableReference>( 62public static PortableExecutableReference VBClasses02 => s_VBClasses02.Value; 64private static readonly Lazy<PortableExecutableReference> s_VBInterfaces01 = new Lazy<PortableExecutableReference>( 67public static PortableExecutableReference VBInterfaces01 => s_VBInterfaces01.Value; 75private static readonly Lazy<PortableExecutableReference> s_mincorlib = new Lazy<PortableExecutableReference>( 78public static PortableExecutableReference mincorlib => s_mincorlib.Value; 80private static readonly Lazy<PortableExecutableReference> s_minasync = new Lazy<PortableExecutableReference>( 83public static PortableExecutableReference minasync => s_minasync.Value; 85private static readonly Lazy<PortableExecutableReference> s_minasynccorlib = new Lazy<PortableExecutableReference>( 88public static PortableExecutableReference minasynccorlib => s_minasynccorlib.Value; 93private static readonly Lazy<PortableExecutableReference> s_tuplelib = new Lazy<PortableExecutableReference>( 96public static PortableExecutableReference tuplelib => s_tuplelib.Value; 101private static readonly Lazy<PortableExecutableReference> s_system = new Lazy<PortableExecutableReference>( 104public static PortableExecutableReference System => s_system.Value; 112private static readonly Lazy<PortableExecutableReference> s_errTestLib01 = new Lazy<PortableExecutableReference>( 115public static PortableExecutableReference dll => s_errTestLib01.Value; 120private static readonly Lazy<PortableExecutableReference> s_errTestLib02 = new Lazy<PortableExecutableReference>( 123public static PortableExecutableReference dll => s_errTestLib02.Value; 128private static readonly Lazy<PortableExecutableReference> s_errTestLib11 = new Lazy<PortableExecutableReference>( 131public static PortableExecutableReference dll => s_errTestLib11.Value; 136private static readonly Lazy<PortableExecutableReference> s_errTestMod01 = new Lazy<PortableExecutableReference>( 139public static PortableExecutableReference dll => s_errTestMod01.Value; 144private static readonly Lazy<PortableExecutableReference> s_errTestMod02 = new Lazy<PortableExecutableReference>( 147public static PortableExecutableReference dll => s_errTestMod02.Value; 152private static readonly Lazy<PortableExecutableReference> s_badresfile = new Lazy<PortableExecutableReference>( 155public static PortableExecutableReference res => s_badresfile.Value; 161private static readonly Lazy<PortableExecutableReference> s_mdTestLib1 = new Lazy<PortableExecutableReference>( 164public static PortableExecutableReference MDTestLib1 => s_mdTestLib1.Value; 166private static readonly Lazy<PortableExecutableReference> s_mdTestLib2 = new Lazy<PortableExecutableReference>( 169public static PortableExecutableReference MDTestLib2 => s_mdTestLib2.Value; 171private static readonly Lazy<PortableExecutableReference> s_VBConversions = new Lazy<PortableExecutableReference>( 174public static PortableExecutableReference VBConversions => s_VBConversions.Value; 176private static readonly Lazy<PortableExecutableReference> s_withSpaces = new Lazy<PortableExecutableReference>( 179public static PortableExecutableReference WithSpaces => s_withSpaces.Value; 181private static readonly Lazy<PortableExecutableReference> s_withSpacesModule = new Lazy<PortableExecutableReference>( 184public static PortableExecutableReference WithSpacesModule => s_withSpacesModule.Value; 186private static readonly Lazy<PortableExecutableReference> s_inheritIComparable = new Lazy<PortableExecutableReference>( 189public static PortableExecutableReference InheritIComparable => s_inheritIComparable.Value; 191private static readonly Lazy<PortableExecutableReference> s_bigVisitor = new Lazy<PortableExecutableReference>( 194public static PortableExecutableReference BigVisitor => s_bigVisitor.Value; 196private static readonly Lazy<PortableExecutableReference> s_properties = new Lazy<PortableExecutableReference>( 199public static PortableExecutableReference Properties => s_properties.Value; 201private static readonly Lazy<PortableExecutableReference> s_propertiesWithByRef = new Lazy<PortableExecutableReference>( 204public static PortableExecutableReference PropertiesWithByRef => s_propertiesWithByRef.Value; 206private static readonly Lazy<PortableExecutableReference> s_indexers = new Lazy<PortableExecutableReference>( 209public static PortableExecutableReference Indexers => s_indexers.Value; 211private static readonly Lazy<PortableExecutableReference> s_events = new Lazy<PortableExecutableReference>( 214public static PortableExecutableReference Events => s_events.Value; 218private static readonly Lazy<PortableExecutableReference> s_netModule1 = new Lazy<PortableExecutableReference>( 221public static PortableExecutableReference netModule1 => s_netModule1.Value; 223private static readonly Lazy<PortableExecutableReference> s_netModule2 = new Lazy<PortableExecutableReference>( 226public static PortableExecutableReference netModule2 => s_netModule2.Value; 228private static readonly Lazy<PortableExecutableReference> s_crossRefModule1 = new Lazy<PortableExecutableReference>( 231public static PortableExecutableReference CrossRefModule1 => s_crossRefModule1.Value; 233private static readonly Lazy<PortableExecutableReference> s_crossRefModule2 = new Lazy<PortableExecutableReference>( 236public static PortableExecutableReference CrossRefModule2 => s_crossRefModule2.Value; 238private static readonly Lazy<PortableExecutableReference> s_crossRefLib = new Lazy<PortableExecutableReference>( 244public static PortableExecutableReference CrossRefLib => s_crossRefLib.Value; 246private static readonly Lazy<PortableExecutableReference> s_hash_module = new Lazy<PortableExecutableReference>( 249public static PortableExecutableReference hash_module => s_hash_module.Value; 251private static readonly Lazy<PortableExecutableReference> s_x64COFF = new Lazy<PortableExecutableReference>( 254public static PortableExecutableReference x64COFF => s_x64COFF.Value; 261private static readonly Lazy<PortableExecutableReference> s_v1MTTestLib1 = new Lazy<PortableExecutableReference>( 264public static PortableExecutableReference dll => s_v1MTTestLib1.Value; 269private static readonly Lazy<PortableExecutableReference> s_v1MTTestLib1 = new Lazy<PortableExecutableReference>( 272public static PortableExecutableReference netmodule => s_v1MTTestLib1.Value; 277private static readonly Lazy<PortableExecutableReference> s_v1MTTestLib2 = new Lazy<PortableExecutableReference>( 280public static PortableExecutableReference dll => s_v1MTTestLib2.Value; 285private static readonly Lazy<PortableExecutableReference> s_v1MTTestLib1 = new Lazy<PortableExecutableReference>( 288public static PortableExecutableReference netmodule => s_v1MTTestLib1.Value; 296private static readonly Lazy<PortableExecutableReference> s_v2MTTestLib1 = new Lazy<PortableExecutableReference>( 299public static PortableExecutableReference dll => s_v2MTTestLib1.Value; 304private static readonly Lazy<PortableExecutableReference> s_v1MTTestLib1 = new Lazy<PortableExecutableReference>( 307public static PortableExecutableReference netmodule => s_v1MTTestLib1.Value; 312private static readonly Lazy<PortableExecutableReference> s_v2MTTestLib3 = new Lazy<PortableExecutableReference>( 315public static PortableExecutableReference dll => s_v2MTTestLib3.Value; 320private static readonly Lazy<PortableExecutableReference> s_v1MTTestLib1 = new Lazy<PortableExecutableReference>( 323public static PortableExecutableReference netmodule => s_v1MTTestLib1.Value; 331private static readonly Lazy<PortableExecutableReference> s_v3MTTestLib1 = new Lazy<PortableExecutableReference>( 334public static PortableExecutableReference dll => s_v3MTTestLib1.Value; 339private static readonly Lazy<PortableExecutableReference> s_v1MTTestLib1 = new Lazy<PortableExecutableReference>( 342public static PortableExecutableReference netmodule => s_v1MTTestLib1.Value; 347private static readonly Lazy<PortableExecutableReference> s_v3MTTestLib4 = new Lazy<PortableExecutableReference>( 350public static PortableExecutableReference dll => s_v3MTTestLib4.Value; 355private static readonly Lazy<PortableExecutableReference> s_v1MTTestLib1 = new Lazy<PortableExecutableReference>( 358public static PortableExecutableReference netmodule => s_v1MTTestLib1.Value; 364private static readonly Lazy<PortableExecutableReference> s_assembly = new Lazy<PortableExecutableReference>( 370public static PortableExecutableReference Assembly => s_assembly.Value; 372private static readonly Lazy<PortableExecutableReference> s_mod2 = new Lazy<PortableExecutableReference>( 375public static PortableExecutableReference mod2 => s_mod2.Value; 377private static readonly Lazy<PortableExecutableReference> s_mod3 = new Lazy<PortableExecutableReference>( 380public static PortableExecutableReference mod3 => s_mod3.Value; 382private static readonly Lazy<PortableExecutableReference> s_consumer = new Lazy<PortableExecutableReference>( 385public static PortableExecutableReference Consumer => s_consumer.Value; 390private static readonly Lazy<PortableExecutableReference> s_typeAndNamespaceDifferByCase = new Lazy<PortableExecutableReference>( 393public static PortableExecutableReference TypeAndNamespaceDifferByCase => s_typeAndNamespaceDifferByCase.Value; 395private static readonly Lazy<PortableExecutableReference> s_differByCaseConsumer = new Lazy<PortableExecutableReference>( 398public static PortableExecutableReference Consumer => s_differByCaseConsumer.Value; 400private static readonly Lazy<PortableExecutableReference> s_csharpCaseSen = new Lazy<PortableExecutableReference>( 403public static PortableExecutableReference CsharpCaseSen => s_csharpCaseSen.Value; 405private static readonly Lazy<PortableExecutableReference> s_csharpDifferCaseOverloads = new Lazy<PortableExecutableReference>( 408public static PortableExecutableReference CsharpDifferCaseOverloads => s_csharpDifferCaseOverloads.Value; 415private static readonly Lazy<PortableExecutableReference> s_exe = new Lazy<PortableExecutableReference>( 418public static PortableExecutableReference exe => s_exe.Value; 421private static readonly Lazy<PortableExecutableReference> s_noMsCorLibRef = new Lazy<PortableExecutableReference>( 424public static PortableExecutableReference NoMsCorLibRef => s_noMsCorLibRef.Value; 428private static readonly Lazy<PortableExecutableReference> s_dll = new Lazy<PortableExecutableReference>( 431public static PortableExecutableReference dll => s_dll.Value; 439private static readonly Lazy<PortableExecutableReference> s_dll = new Lazy<PortableExecutableReference>( 442public static PortableExecutableReference dll => s_dll.Value; 444private static readonly Lazy<PortableExecutableReference> s_module = new Lazy<PortableExecutableReference>( 447public static PortableExecutableReference netmodule => s_module.Value; 450private static readonly Lazy<PortableExecutableReference> s_modoptTests = new Lazy<PortableExecutableReference>( 453public static PortableExecutableReference ModoptTests => s_modoptTests.Value; 457private static readonly Lazy<PortableExecutableReference> s_dll = new Lazy<PortableExecutableReference>( 460public static PortableExecutableReference dll => s_dll.Value; 465private static readonly Lazy<PortableExecutableReference> s_dll = new Lazy<PortableExecutableReference>( 468public static PortableExecutableReference dll => s_dll.Value; 476private static readonly Lazy<PortableExecutableReference> s_cyclic1 = new Lazy<PortableExecutableReference>( 479public static PortableExecutableReference dll => s_cyclic1.Value; 484private static readonly Lazy<PortableExecutableReference> s_cyclic2 = new Lazy<PortableExecutableReference>( 487public static PortableExecutableReference dll => s_cyclic2.Value; 493private static readonly Lazy<PortableExecutableReference> s_class1 = new Lazy<PortableExecutableReference>( 496public static PortableExecutableReference Class1 => s_class1.Value; 498private static readonly Lazy<PortableExecutableReference> s_class2 = new Lazy<PortableExecutableReference>( 501public static PortableExecutableReference Class2 => s_class2.Value; 503private static readonly Lazy<PortableExecutableReference> s_class3 = new Lazy<PortableExecutableReference>( 506public static PortableExecutableReference Class3 => s_class3.Value; 509private static readonly Lazy<PortableExecutableReference> s_cycledStructs = new Lazy<PortableExecutableReference>( 512public static PortableExecutableReference CycledStructs => s_cycledStructs.Value; 520private static readonly Lazy<PortableExecutableReference> s_classA = new Lazy<PortableExecutableReference>( 523public static PortableExecutableReference dll => s_classA.Value; 528private static readonly Lazy<PortableExecutableReference> s_classB = new Lazy<PortableExecutableReference>( 531public static PortableExecutableReference netmodule => s_classB.Value; 539private static readonly Lazy<PortableExecutableReference> s_classA = new Lazy<PortableExecutableReference>( 542public static PortableExecutableReference dll => s_classA.Value; 547private static readonly Lazy<PortableExecutableReference> s_classB = new Lazy<PortableExecutableReference>( 550public static PortableExecutableReference dll => s_classB.Value; 557private static readonly Lazy<PortableExecutableReference> s_CSMethods = new Lazy<PortableExecutableReference>( 560public static PortableExecutableReference CSMethods => s_CSMethods.Value; 562private static readonly Lazy<PortableExecutableReference> s_VBMethods = new Lazy<PortableExecutableReference>( 565public static PortableExecutableReference VBMethods => s_VBMethods.Value; 567private static readonly Lazy<PortableExecutableReference> s_ILMethods = new Lazy<PortableExecutableReference>( 570public static PortableExecutableReference ILMethods => s_ILMethods.Value; 572private static readonly Lazy<PortableExecutableReference> s_byRefReturn = new Lazy<PortableExecutableReference>( 575public static PortableExecutableReference ByRefReturn => s_byRefReturn.Value; 582private static readonly Lazy<PortableExecutableReference> s_CSFields = new Lazy<PortableExecutableReference>( 585public static PortableExecutableReference dll => s_CSFields.Value; 590private static readonly Lazy<PortableExecutableReference> s_VBFields = new Lazy<PortableExecutableReference>( 593public static PortableExecutableReference dll => s_VBFields.Value; 596private static readonly Lazy<PortableExecutableReference> s_constantFields = new Lazy<PortableExecutableReference>( 599public static PortableExecutableReference ConstantFields => s_constantFields.Value; 604private static readonly Lazy<PortableExecutableReference> s_MDMissingType = new Lazy<PortableExecutableReference>( 607public static PortableExecutableReference MDMissingType => s_MDMissingType.Value; 609private static readonly Lazy<PortableExecutableReference> s_MDMissingTypeLib = new Lazy<PortableExecutableReference>( 612public static PortableExecutableReference MDMissingTypeLib => s_MDMissingTypeLib.Value; 614private static readonly Lazy<PortableExecutableReference> s_missingTypesEquality1 = new Lazy<PortableExecutableReference>( 617public static PortableExecutableReference MissingTypesEquality1 => s_missingTypesEquality1.Value; 619private static readonly Lazy<PortableExecutableReference> s_missingTypesEquality2 = new Lazy<PortableExecutableReference>( 622public static PortableExecutableReference MissingTypesEquality2 => s_missingTypesEquality2.Value; 624private static readonly Lazy<PortableExecutableReference> s_CL2 = new Lazy<PortableExecutableReference>( 627public static PortableExecutableReference CL2 => s_CL2.Value; 629private static readonly Lazy<PortableExecutableReference> s_CL3 = new Lazy<PortableExecutableReference>( 632public static PortableExecutableReference CL3 => s_CL3.Value; 639private static readonly Lazy<PortableExecutableReference> s_typeForwarder2 = new Lazy<PortableExecutableReference>( 642public static PortableExecutableReference dll => s_typeForwarder2.Value; 647private static readonly Lazy<PortableExecutableReference> s_typeForwarderLib2 = new Lazy<PortableExecutableReference>( 650public static PortableExecutableReference dll => s_typeForwarderLib2.Value; 655private static readonly Lazy<PortableExecutableReference> s_typeForwarderBase2 = new Lazy<PortableExecutableReference>( 658public static PortableExecutableReference dll => s_typeForwarderBase2.Value; 664private static readonly Lazy<PortableExecutableReference> s_source1Module = new Lazy<PortableExecutableReference>( 667public static PortableExecutableReference Source1Module => s_source1Module.Value; 669private static readonly Lazy<PortableExecutableReference> s_source3Module = new Lazy<PortableExecutableReference>( 672public static PortableExecutableReference Source3Module => s_source3Module.Value; 674private static readonly Lazy<PortableExecutableReference> s_source4Module = new Lazy<PortableExecutableReference>( 677public static PortableExecutableReference Source4Module => s_source4Module.Value; 679private static readonly Lazy<PortableExecutableReference> s_source5Module = new Lazy<PortableExecutableReference>( 682public static PortableExecutableReference Source5Module => s_source5Module.Value; 684private static readonly Lazy<PortableExecutableReference> s_source7Module = new Lazy<PortableExecutableReference>( 687public static PortableExecutableReference Source7Module => s_source7Module.Value; 692private static readonly Lazy<PortableExecutableReference> s_stdOleNetFramework = new Lazy<PortableExecutableReference>( 694public static PortableExecutableReference StdOleNetFramework => s_stdOleNetFramework.Value; 696private static readonly Lazy<PortableExecutableReference> s_stdOleNet40 = new Lazy<PortableExecutableReference>( 698public static PortableExecutableReference StdOleNet40 => s_stdOleNet40.Value; 700private static readonly Lazy<PortableExecutableReference> s_pia1 = new Lazy<PortableExecutableReference>( 703public static PortableExecutableReference Pia1 => s_pia1.Value; 705private static readonly Lazy<PortableExecutableReference> s_pia1Copy = new Lazy<PortableExecutableReference>( 708public static PortableExecutableReference Pia1Copy => s_pia1Copy.Value; 710private static readonly Lazy<PortableExecutableReference> s_pia2 = new Lazy<PortableExecutableReference>( 713public static PortableExecutableReference Pia2 => s_pia2.Value; 715private static readonly Lazy<PortableExecutableReference> s_pia3 = new Lazy<PortableExecutableReference>( 718public static PortableExecutableReference Pia3 => s_pia3.Value; 720private static readonly Lazy<PortableExecutableReference> s_pia4 = new Lazy<PortableExecutableReference>( 723public static PortableExecutableReference Pia4 => s_pia4.Value; 725private static readonly Lazy<PortableExecutableReference> s_pia5 = new Lazy<PortableExecutableReference>( 728public static PortableExecutableReference Pia5 => s_pia5.Value; 730private static readonly Lazy<PortableExecutableReference> s_generalPia = new Lazy<PortableExecutableReference>( 733public static PortableExecutableReference GeneralPia => s_generalPia.Value; 735private static readonly Lazy<PortableExecutableReference> s_generalPiaCopy = new Lazy<PortableExecutableReference>( 738public static PortableExecutableReference GeneralPiaCopy => s_generalPiaCopy.Value; 740private static readonly Lazy<PortableExecutableReference> s_noPIAGenericsAsm1 = new Lazy<PortableExecutableReference>( 743public static PortableExecutableReference NoPIAGenericsAsm1 => s_noPIAGenericsAsm1.Value; 745private static readonly Lazy<PortableExecutableReference> s_externalAsm1 = new Lazy<PortableExecutableReference>( 748public static PortableExecutableReference ExternalAsm1 => s_externalAsm1.Value; 750private static readonly Lazy<PortableExecutableReference> s_library1 = new Lazy<PortableExecutableReference>( 753public static PortableExecutableReference Library1 => s_library1.Value; 755private static readonly Lazy<PortableExecutableReference> s_library2 = new Lazy<PortableExecutableReference>( 758public static PortableExecutableReference Library2 => s_library2.Value; 760private static readonly Lazy<PortableExecutableReference> s_localTypes1 = new Lazy<PortableExecutableReference>( 763public static PortableExecutableReference LocalTypes1 => s_localTypes1.Value; 765private static readonly Lazy<PortableExecutableReference> s_localTypes2 = new Lazy<PortableExecutableReference>( 768public static PortableExecutableReference LocalTypes2 => s_localTypes2.Value; 770private static readonly Lazy<PortableExecutableReference> s_localTypes3 = new Lazy<PortableExecutableReference>( 773public static PortableExecutableReference LocalTypes3 => s_localTypes3.Value; 775private static readonly Lazy<PortableExecutableReference> s_A = new Lazy<PortableExecutableReference>( 778public static PortableExecutableReference A => s_A.Value; 780private static readonly Lazy<PortableExecutableReference> s_B = new Lazy<PortableExecutableReference>( 783public static PortableExecutableReference B => s_B.Value; 785private static readonly Lazy<PortableExecutableReference> s_C = new Lazy<PortableExecutableReference>( 788public static PortableExecutableReference C => s_C.Value; 790private static readonly Lazy<PortableExecutableReference> s_D = new Lazy<PortableExecutableReference>( 793public static PortableExecutableReference D => s_D.Value; 799private static readonly Lazy<PortableExecutableReference> s_missingPIAAttributes = new Lazy<PortableExecutableReference>( 802public static PortableExecutableReference MissingPIAAttributes => s_missingPIAAttributes.Value; 809private static readonly Lazy<PortableExecutableReference> s_staticMethodInInterface = new Lazy<PortableExecutableReference>( 812public static PortableExecutableReference StaticMethodInInterface => s_staticMethodInInterface.Value; 814private static readonly Lazy<PortableExecutableReference> s_MDInterfaceMapping = new Lazy<PortableExecutableReference>( 817public static PortableExecutableReference MDInterfaceMapping => s_MDInterfaceMapping.Value; 822private static readonly Lazy<PortableExecutableReference> s_MDTestLib1 = new Lazy<PortableExecutableReference>( 825public static PortableExecutableReference MDTestLib1 => s_MDTestLib1.Value; 827private static readonly Lazy<PortableExecutableReference> s_netModule1 = new Lazy<PortableExecutableReference>( 830public static PortableExecutableReference netModule1 => s_netModule1.Value; 837private static readonly Lazy<PortableExecutableReference> s_CSharp = new Lazy<PortableExecutableReference>( 840public static PortableExecutableReference CSharp => s_CSharp.Value; 842private static readonly Lazy<PortableExecutableReference> s_IL = new Lazy<PortableExecutableReference>( 845public static PortableExecutableReference IL => s_IL.Value; 850private static readonly Lazy<PortableExecutableReference> s_CSharp = new Lazy<PortableExecutableReference>( 853public static PortableExecutableReference CSharp => s_CSharp.Value; 855private static readonly Lazy<PortableExecutableReference> s_IL = new Lazy<PortableExecutableReference>( 858public static PortableExecutableReference IL => s_IL.Value; 863private static readonly Lazy<PortableExecutableReference> s_CSharp = new Lazy<PortableExecutableReference>( 866public static PortableExecutableReference CSharp => s_CSharp.Value; 870private static readonly Lazy<PortableExecutableReference> s_regress40025 = new Lazy<PortableExecutableReference>( 873public static PortableExecutableReference Regress40025 => s_regress40025.Value; 877private static readonly Lazy<PortableExecutableReference> s_simpleWithEvents = new Lazy<PortableExecutableReference>( 880public static PortableExecutableReference SimpleWithEvents => s_simpleWithEvents.Value; 885private static readonly Lazy<PortableExecutableReference> s_delegatesWithoutInvoke = new Lazy<PortableExecutableReference>( 888public static PortableExecutableReference DelegatesWithoutInvoke => s_delegatesWithoutInvoke.Value; 890private static readonly Lazy<PortableExecutableReference> s_delegateByRefParamArray = new Lazy<PortableExecutableReference>( 893public static PortableExecutableReference DelegateByRefParamArray => s_delegateByRefParamArray.Value; 898private static readonly Lazy<PortableExecutableReference> s_invalidCharactersInAssemblyName2 = new Lazy<PortableExecutableReference>( 901public static PortableExecutableReference InvalidCharactersInAssemblyName => s_invalidCharactersInAssemblyName2.Value; 903private static readonly Lazy<PortableExecutableReference> s_MDTestAttributeDefLib = new Lazy<PortableExecutableReference>( 906public static PortableExecutableReference MDTestAttributeDefLib => s_MDTestAttributeDefLib.Value; 908private static readonly Lazy<PortableExecutableReference> s_MDTestAttributeApplicationLib = new Lazy<PortableExecutableReference>( 911public static PortableExecutableReference MDTestAttributeApplicationLib => s_MDTestAttributeApplicationLib.Value; 913private static readonly Lazy<PortableExecutableReference> s_attributeInterop01 = new Lazy<PortableExecutableReference>( 916public static PortableExecutableReference AttributeInterop01 => s_attributeInterop01.Value; 918private static readonly Lazy<PortableExecutableReference> s_attributeInterop02 = new Lazy<PortableExecutableReference>( 921public static PortableExecutableReference AttributeInterop02 => s_attributeInterop02.Value; 923private static readonly Lazy<PortableExecutableReference> s_attributeTestLib01 = new Lazy<PortableExecutableReference>( 926public static PortableExecutableReference AttributeTestLib01 => s_attributeTestLib01.Value; 928private static readonly Lazy<PortableExecutableReference> s_attributeTestDef01 = new Lazy<PortableExecutableReference>( 931public static PortableExecutableReference AttributeTestDef01 => s_attributeTestDef01.Value; 933private static readonly Lazy<PortableExecutableReference> s_dynamicAttributeLib = new Lazy<PortableExecutableReference>( 936public static PortableExecutableReference DynamicAttributeLib => s_dynamicAttributeLib.Value; 941private static readonly Lazy<PortableExecutableReference> s_unavailable = new Lazy<PortableExecutableReference>( 944public static PortableExecutableReference Unavailable => s_unavailable.Value; 946private static readonly Lazy<PortableExecutableReference> s_CSharp = new Lazy<PortableExecutableReference>( 949public static PortableExecutableReference CSharp => s_CSharp.Value; 951private static readonly Lazy<PortableExecutableReference> s_IL = new Lazy<PortableExecutableReference>( 954public static PortableExecutableReference IL => s_IL.Value; 959private static readonly Lazy<PortableExecutableReference> s_AR_SA = new Lazy<PortableExecutableReference>( 962public static PortableExecutableReference AR_SA => s_AR_SA.Value; 964private static readonly Lazy<PortableExecutableReference> s_EN_US = new Lazy<PortableExecutableReference>( 967public static PortableExecutableReference EN_US => s_EN_US.Value; 969private static readonly Lazy<PortableExecutableReference> s_C1 = new Lazy<PortableExecutableReference>( 972public static PortableExecutableReference C1 => s_C1.Value; 974private static readonly Lazy<PortableExecutableReference> s_C2 = new Lazy<PortableExecutableReference>( 977public static PortableExecutableReference C2 => s_C2.Value;
Platform\Desktop\DesktopRuntimeUtil.cs (1)
39internal static PortableExecutableReference CreateMetadataReferenceFromHexGZipImage(
TargetFrameworkUtil.cs (19)
104public static PortableExecutableReference netstandard { get; } = Net70.References.netstandard; 105public static PortableExecutableReference mscorlib { get; } = Net70.References.mscorlib; 106public static PortableExecutableReference SystemRuntime { get; } = Net70.References.SystemRuntime; 154public static PortableExecutableReference mscorlib { get; } = Net461.References.mscorlib; 155public static PortableExecutableReference System { get; } = Net461.References.System; 156public static PortableExecutableReference SystemRuntime { get; } = Net461.References.SystemRuntime; 157public static PortableExecutableReference SystemCore { get; } = Net461.References.SystemCore; 158public static PortableExecutableReference SystemData { get; } = Net461.References.SystemData; 159public static PortableExecutableReference SystemThreadingTasks { get; } = Net461.References.SystemThreadingTasks; 160public static PortableExecutableReference SystemXml { get; } = Net461.References.SystemXml; 161public static PortableExecutableReference SystemValueTuple { get; } = Net461.ExtraReferences.SystemValueTuple; 162public static PortableExecutableReference MicrosoftCSharp { get; } = Net461.References.MicrosoftCSharp; 163public static PortableExecutableReference MicrosoftVisualBasic { get; } = Net461.References.MicrosoftVisualBasic; 168private static readonly ConcurrentDictionary<string, ImmutableArray<PortableExecutableReference>> s_dynamicReferenceMap = new ConcurrentDictionary<string, ImmutableArray<PortableExecutableReference>>(StringComparer.Ordinal); 379if (m is PortableExecutableReference p && 400.Where(x => !(x is PortableExecutableReference pe && excludeReferenceNames.Contains(pe.FilePath))); 408private static ImmutableArray<PortableExecutableReference> LoadDynamicReferences(string targetFrameworkName) 429references = ((IEnumerable<PortableExecutableReference>)obj).ToImmutableArray();
TestBase.cs (8)
102var winmd = AssemblyMetadata.CreateFromImage(TestResources.WinRt.Windows).GetReference(display: "Windows"); 104var windowsruntime = 107var runtime = 110var objectModel = 113var uixaml = AssemblyMetadata.CreateFromImage(TestResources.NetFX.WinRt.SystemRuntimeWindowsRuntimeUIXaml). 116var interop = AssemblyMetadata.CreateFromImage(Net461.Resources.SystemRuntimeInteropServicesWindowsRuntime). 120var system = AssemblyMetadata.CreateFromImage(Net461.Resources.System).GetReference(display: "System.dll"); 122var mscor = AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib).GetReference(display: "mscorlib");
Microsoft.CodeAnalysis.UnitTests (33)
AnalyzerAssemblyLoaderTests.cs (2)
1202var compilerReference = MetadataReference.CreateFromFile(typeof(SyntaxNode).Assembly.Location); 1203var immutableReference = MetadataReference.CreateFromFile(typeof(ImmutableArray).Assembly.Location);
MetadataReferences\MetadataReferenceTests.cs (31)
98var r = MetadataReference.CreateFromStream(stream); 118var r = MetadataReference.CreateFromStream(new MemoryStream(TestResources.General.C1, writable: false)); 129var r = MetadataReference.CreateFromStream( 145var r = MetadataReference.CreateFromStream( 163var r = MetadataReference.CreateFromFile(file.Path, 187var r = MetadataReference.CreateFromFile(file.Path, MetadataReferenceProperties.Module); 208var r = (PortableExecutableReference)MetadataReference.CreateFromAssemblyInternal(assembly); 225var r = (PortableExecutableReference)MetadataReference.CreateFromAssemblyInternal(assembly, new MetadataReferenceProperties(MetadataImageKind.Assembly, ImmutableArray.Create("a", "b"), embedInteropTypes: true), documentation: doc); 257var r = module.GetReference(filePath: @"c:\temp", display: "hello", documentation: doc); 266var r1 = r.WithAliases(default(ImmutableArray<string>)); 270var r2 = r.WithEmbedInteropTypes(false); 274var r3 = r.WithProperties(new MetadataReferenceProperties(MetadataImageKind.Module)); 277var r4 = r.WithProperties(new MetadataReferenceProperties(MetadataImageKind.Assembly)); 290var r = assembly.GetReference( 305var r2 = r.WithEmbedInteropTypes(true); 309var r3 = r.WithAliases(ImmutableArray.Create("b", "c")); 317var r4 = r.WithEmbedInteropTypes(false); 325var r5 = r.WithProperties(new MetadataReferenceProperties(MetadataImageKind.Module)); 330var r6 = r.WithProperties(new MetadataReferenceProperties(MetadataImageKind.Assembly, ImmutableArray.Create("x"), embedInteropTypes: true)); 404var mmr1 = module.GetReference(); 409var r = module.GetReference(filePath: path); 419var mmr1 = assembly.GetReference(); 424var r = assembly.GetReference(filePath: path); 487protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties) 515protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties) 529var i1 = AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib).GetReference(display: "i1"); 530var i2 = AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib).GetReference(display: "i2"); 568var corlib = AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib). 584var r = MetadataReference.CreateFromStream(new MemoryStream(TestResources.SymbolsTests.Metadata.InvalidPublicKey, writable: false));
Microsoft.CodeAnalysis.VisualBasic (3)
CommandLine\VisualBasicCommandLineArguments.vb (1)
88Dim assemblyMetadata = TryCast(DirectCast(reference, PortableExecutableReference).GetMetadataNoCopy(), AssemblyMetadata)
Symbols\ReferenceManager.vb (1)
328ImmutableDictionary(Of AssemblyIdentity, PortableExecutableReference).Empty)
Symbols\Source\SourceAssemblySymbol.vb (1)
1354Dim fileRef = TryCast(pair.Key, PortableExecutableReference)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (3)
CommandLineTests.vb (3)
2514Public Overrides Function ResolveReference(reference As String, baseFilePath As String, properties As MetadataReferenceProperties) As ImmutableArray(Of PortableExecutableReference) 2543Dim peRef = TryCast(r, PortableExecutableReference) 2559Dim peRef = TryCast(r, PortableExecutableReference)
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (2)
ScriptTests.vb (2)
18''' Need to create a <see cref="PortableExecutableReference"/> without a file path here. Scripting 22Private Shared ReadOnly s_msvbReference As PortableExecutableReference = AssemblyMetadata.CreateFromImage(Net461.Resources.MicrosoftVisualBasic).GetReference()
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Compilation\CompilationAPITests.vb (1)
2439Protected Overrides Function WithPropertiesImpl(properties As MetadataReferenceProperties) As PortableExecutableReference
Microsoft.CodeAnalysis.Workspaces (75)
FindSymbols\Declarations\DeclarationFinder.cs (1)
70PortableExecutableReference reference,
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (2)
115foreach (var peReference in project.MetadataReferences.OfType<PortableExecutableReference>())
FindSymbols\FindReferences\DependentProjectsFinder.cs (3)
27/// Cache from the <see cref="MetadataId"/> for a particular <see cref="PortableExecutableReference"/> to the 329using var _ = ArrayBuilder<(PortableExecutableReference reference, MetadataId metadataId)>.GetInstance(out var uncomputedReferences); 335if (reference is not PortableExecutableReference peReference)
FindSymbols\FindReferences\DependentTypeFinder.cs (4)
118using var _4 = PooledHashSet<PortableExecutableReference>.GetInstance(out var seenPEReferences); 310if (reference is not PortableExecutableReference peReference) 328seenPEReferences.AddRange(compilation.References.OfType<PortableExecutableReference>()); 335PortableExecutableReference reference,
FindSymbols\SymbolTree\ISymbolTreeInfoCacheService.cs (2)
13/// for metadata symbols in <see cref="PortableExecutableReference"/>s. 18ValueTask<SymbolTreeInfo?> TryGetPotentiallyStaleMetadataSymbolTreeInfoAsync(Project project, PortableExecutableReference reference, CancellationToken cancellationToken);
FindSymbols\SymbolTree\SymbolTreeInfo.cs (1)
20/// cref="Project"/> or <see cref="PortableExecutableReference"/>. This tree can be used to quickly determine if
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (17)
32/// cref="PortableExecutableReference"/>. Generating symbol trees for metadata can be expensive (in large 40private static readonly ConditionalWeakTable<PortableExecutableReference, AsyncLazy<SymbolTreeInfo>> s_peReferenceToInfo = new(); 45/// cref="PortableExecutableReference"/>s, while having different checksums. For example, if the aliases of a 46/// <see cref="PortableExecutableReference"/> are changed (see <see 47/// cref="PortableExecutableReference.WithAliases(IEnumerable{string})"/>, then it will have a different 70public static MetadataId? GetMetadataIdNoThrow(PortableExecutableReference reference) 82private static Metadata? GetMetadataNoThrow(PortableExecutableReference reference) 95/// Produces a <see cref="SymbolTreeInfo"/> for a given <see cref="PortableExecutableReference"/>. 104PortableExecutableReference reference, 117/// Produces a <see cref="SymbolTreeInfo"/> for a given <see cref="PortableExecutableReference"/>. 127PortableExecutableReference reference, 146PortableExecutableReference reference, 171PortableExecutableReference reference, 201public static async Task<SymbolTreeInfo?> TryGetCachedInfoForMetadataReferenceIgnoreChecksumAsync(PortableExecutableReference reference, CancellationToken cancellationToken) 211SolutionServices services, PortableExecutableReference reference, CancellationToken cancellationToken) 228private static string GetMetadataKeySuffix(PortableExecutableReference reference) 238PortableExecutableReference reference,
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (5)
30private readonly ConcurrentDictionary<PortableExecutableReference, MetadataInfo> _peReferenceToInfo = []; 69PortableExecutableReference reference, 152foreach (var reference in project.MetadataReferences.OfType<PortableExecutableReference>().Distinct()) 191PortableExecutableReference reference,
Serialization\SerializedPortableExecutableReference.cs (2)
51protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties) 60{nameof(PortableExecutableReference)}
Serialization\SerializerService_Reference.cs (12)
48if (reference is PortableExecutableReference portable) 92if (reference is PortableExecutableReference portable) 110if (type == nameof(PortableExecutableReference)) 177PortableExecutableReference reference, SerializationKinds kind, ObjectWriter writer) 179writer.WriteString(nameof(PortableExecutableReference)); 185private static void WritePortableExecutableReferencePropertiesTo(PortableExecutableReference reference, ObjectWriter writer) 191private static Checksum CreatePortableExecutableReferenceChecksum(PortableExecutableReference reference) 265PortableExecutableReference reference, ObjectWriter writer) 273private PortableExecutableReference ReadPortableExecutableReferenceFrom(ObjectReader reader) 352PortableExecutableReference reference, 491private static Metadata? TryGetMetadata(PortableExecutableReference reference) 534protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties)
Workspace\Host\Metadata\IMetadataService.cs (1)
11PortableExecutableReference GetReference(string resolvedPath, MetadataReferenceProperties properties);
Workspace\Host\Metadata\MetadataServiceFactory.cs (2)
30public PortableExecutableReference GetReference(string resolvedPath, MetadataReferenceProperties properties) 31=> (PortableExecutableReference)_metadataCache.GetReference(resolvedPath, properties);
Workspace\Host\Metadata\WorkspaceMetadataFileReferenceResolver.cs (1)
28public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties)
Workspace\ProjectSystem\ProjectSystemProject.cs (5)
685var metadataReference = projectBeforeMutation.MetadataReferences 686.OfType<PortableExecutableReference>() 712var metadataReference = CreateMetadataReference_NoLock(path, properties, solutionChanges.Solution.Services); 1398foreach (var reference in originalMetadataReferences.OfType<PortableExecutableReference>())
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (8)
46public FileWatchedReferenceFactory<PortableExecutableReference> FileWatchedPortableExecutableReferenceFactory { get; } 425foreach (var reference in projectUpdateState.RemovedMetadataReferences) 429foreach (var reference in projectUpdateState.AddedMetadataReferences) 561if (reference is PortableExecutableReference peReference 657var metadataReference = CreateMetadataReference_NoLock( 813public static PortableExecutableReference CreateMetadataReference_NoLock( 822getReferences: static project => project.MetadataReferences.OfType<PortableExecutableReference>(), 860/// cref="PortableExecutableReference"/> or <see cref="AnalyzerFileReference"/>.
Workspace\ProjectSystem\ProjectSystemProjectFactory.ProjectUpdateState.cs (4)
55ImmutableArray<PortableExecutableReference> RemovedMetadataReferences, 56ImmutableArray<PortableExecutableReference> AddedMetadataReferences, 118public ProjectUpdateState WithIncrementalMetadataReferenceRemoved(PortableExecutableReference reference) 121public ProjectUpdateState WithIncrementalMetadataReferenceAdded(PortableExecutableReference reference)
Workspace\Solution\SolutionCompilationState.RootedSymbolSet.cs (1)
19=> new(reference.Properties, (reference as PortableExecutableReference)?.FilePath);
Workspace\Solution\SolutionCompilationState.SkeletonReferenceSet.cs (3)
32private readonly Dictionary<MetadataReferenceProperties, PortableExecutableReference> _referenceMap = []; 36public PortableExecutableReference GetOrCreateMetadataReference(MetadataReferenceProperties properties) 40if (!_referenceMap.TryGetValue(properties, out var value))
Workspace\Workspace.cs (1)
1430if (meta is PortableExecutableReference pemeta)
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (1)
86PortableExecutableReference portableExecutableReference => portableExecutableReference.FilePath,
MSBuild\MSBuildWorkspace.cs (2)
581if (metadataReference is PortableExecutableReference peRef && peRef.FilePath != null) 617if (metadataReference is PortableExecutableReference peRef && peRef.FilePath != null)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (19)
VisualStudioMSBuildWorkspaceTests.cs (19)
80var fileNames = new HashSet<string>(references.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath))); 184.OfType<PortableExecutableReference>() 189.OfType<PortableExecutableReference>() 195=> ((PortableExecutableReference)metadataReference).GetMetadata(); 322var pref = c2.References.OfType<PortableExecutableReference>().FirstOrDefault(r => r.Display == "CSharpProject"); 349var pref = c2.References.OfType<PortableExecutableReference>().FirstOrDefault(r => r.Display == "EmittedCSharpProject"); 790var csharpLib = refs.OfType<PortableExecutableReference>().FirstOrDefault(r => r.FilePath.Contains("Microsoft.CSharp")); 1329Assert.Contains(metaRefs, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll")); 1351Assert.Contains(project.MetadataReferences, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll")); 1397Assert.Contains(metaRefs, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll")); 1439Assert.Contains(vbProject.MetadataReferences, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll")); 1902var mtref = MetadataReference.CreateFromImage(metadataBytes); 1925var mtref = MetadataReference.CreateFromImage(metadataBytes); 1949var mtref = MetadataReference.CreateFromImage(metadataBytes); 1972var mtref = MetadataReference.CreateFromImage(metadataBytes); 3219project.MetadataReferences.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)).OrderBy(StringComparer.Ordinal));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
744var metadataReference = MetadataReference.CreateFromImage(image, new MetadataReferenceProperties(aliases: aliases), includeXmlDocComments ? new DeferredDocumentationProvider(compilation) : null);
Microsoft.CodeAnalysis.Workspaces.UnitTests (15)
CommandLineProject\CommandLineProjectTests.cs (2)
180Assert.Single(info.MetadataReferences.OfType<PortableExecutableReference>(), r => r.FilePath == pathToAssembly); 192Assert.Single(info.MetadataReferences.OfType<PortableExecutableReference>(), r => r.FilePath == pathToAssembly);
FindReferencesTests.cs (1)
125.AddMetadataReference(pid, ((PortableExecutableReference)MscorlibRef).WithAliases(["X"]))
SolutionTests\SolutionTests.cs (1)
2941var mefReference = NetFramework.SystemCore;
UtilityTest\XmlDocumentationProviderTests.cs (1)
36var portableExecutableReference = MetadataReference.CreateFromFile(roslynCompilersLocation, documentation: documentationProvider);
WorkspaceTests\WorkspaceReferenceTests.cs (10)
27metadataReferences: ImmutableArray.Create<MetadataReference>(PortableExecutableReference.CreateFromFile(typeof(object).Assembly.Location))); 56metadataReferences: ImmutableArray.Create<MetadataReference>(PortableExecutableReference.CreateFromFile(typeof(object).Assembly.Location))); 67metadataReferences: ImmutableArray.Create<MetadataReference>(PortableExecutableReference.CreateFromFile(typeof(object).Assembly.Location))); 96metadataReferences: ImmutableArray.Create<MetadataReference>(PortableExecutableReference.CreateFromFile(typeof(object).Assembly.Location))); 107metadataReferences: ImmutableArray.Create<MetadataReference>(PortableExecutableReference.CreateFromFile(typeof(object).Assembly.Location))); 136metadataReferences: ImmutableArray.Create<MetadataReference>(PortableExecutableReference.CreateFromFile(typeof(object).Assembly.Location))); 147metadataReferences: ImmutableArray.Create<MetadataReference>(PortableExecutableReference.CreateFromFile(typeof(object).Assembly.Location))); 180metadataReferences: ImmutableArray.Create<MetadataReference>(PortableExecutableReference.CreateFromFile(typeof(object).Assembly.Location))); 190PortableExecutableReference.CreateFromFile(typeof(object).Assembly.Location), 191PortableExecutableReference.CreateFromFile(typeof(Workspace).Assembly.Location)));
Microsoft.VisualStudio.LanguageServices (19)
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (1)
139if (referenceListItem.MetadataReference is PortableExecutableReference portableExecutableReference)
Library\ObjectBrowser\AbstractListItemFactory.cs (1)
620if (reference is PortableExecutableReference portableExecutableReference)
Library\ObjectBrowser\ObjectList.cs (2)
845if (referenceListItem.MetadataReference is not PortableExecutableReference metadataReference) 927if (referenceListItem.MetadataReference is not PortableExecutableReference portableExecutableReference)
Library\VsNavInfo\NavInfoFactory.cs (2)
26if (reference is PortableExecutableReference portableExecutableReference) 154libraryName = compilation.GetMetadataReference(containingAssembly) is PortableExecutableReference portableExecutableReference
Progression\GraphNodeIdCreation.cs (1)
428if (compilation.GetMetadataReference(containingAssembly) is PortableExecutableReference reference && !string.IsNullOrEmpty(reference.FilePath))
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (2)
30/// They monitor changes in the underlying files and provide snapshot references (subclasses of <see cref="PortableExecutableReference"/>) 122public PortableExecutableReference CreateMetadataReferenceSnapshot(string filePath, MetadataReferenceProperties properties)
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceProviderServiceFactory.cs (1)
29public PortableExecutableReference GetReference(string resolvedPath, MetadataReferenceProperties properties)
ProjectSystem\MetadataReferences\VisualStudioPortableExecutableReference.cs (2)
26/// cref="PortableExecutableReference.GetMetadataImpl()"/> and the observed metadata is memoized by the compilation. 104protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties)
ProjectSystem\VisualStudioWorkspace.cs (2)
72/// Creates a <see cref="PortableExecutableReference" /> that correctly retrieves the Visual Studio context, 77public PortableExecutableReference CreatePortableExecutableReference(string filePath, MetadataReferenceProperties properties)
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (2)
35var reference = fromProject.MetadataReferences.OfType<PortableExecutableReference>()
ProjectSystem\VisualStudioWorkspaceImpl.cs (1)
563if (metadataReference is PortableExecutableReference fileMetadata)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (2)
34var reference = fromProject.MetadataReferences.OfType<PortableExecutableReference>()
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
ProjectSystemShim\CPS\CSharpReferencesTests.cs (2)
55IEnumerable<PortableExecutableReference> GetProject3MetadataReferences() 59.Cast<PortableExecutableReference>();
ProjectSystemShim\TempPECompilerServiceTests.cs (1)
44public PortableExecutableReference GetReference(string resolvedPath, MetadataReferenceProperties properties)
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))
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
ReferenceManager\VisualStudioMetadataReferenceManagerTests.vb (1)
77Protected Overrides Function WithPropertiesImpl(properties As MetadataReferenceProperties) As PortableExecutableReference
SemanticSearch.BuildTask (1)
GenerateFilteredReferenceAssembliesTask.cs (1)
281var metadataRef = MetadataReference.CreateFromStream(readableStream);
SemanticSearch.BuildTask.UnitTests (3)
GenerateFilteredReferenceAssembliesTaskTests.cs (3)
121var libRef = MetadataReference.CreateFromImage(libImage); 166var libRef = MetadataReference.CreateFromImage(libImage); 208var libRef = MetadataReference.CreateFromImage(libImage);
StackDepthTest (1)
Program.cs (1)
80var reference = MetadataReference.CreateFromFile(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\mscorlib.dll");
VBCSCompiler (11)
src\Compilers\Server\VBCSCompiler\CompilerRequestHandler.cs (2)
46public static Func<string, MetadataReferenceProperties, PortableExecutableReference> SharedAssemblyReferenceProvider { get; } = (path, properties) => new CachingMetadataReference(path, properties); 51private Func<string, MetadataReferenceProperties, PortableExecutableReference> AssemblyReferenceProvider { get; } = SharedAssemblyReferenceProvider;
src\Compilers\Server\VBCSCompiler\CSharpCompilerServer.cs (4)
17private readonly Func<string, MetadataReferenceProperties, PortableExecutableReference> _metadataProvider; 19internal CSharpCompilerServer(Func<string, MetadataReferenceProperties, PortableExecutableReference> metadataProvider, string[] args, BuildPaths buildPaths, string? libDirectory, IAnalyzerAssemblyLoader analyzerLoader, GeneratorDriverCache driverCache) 24internal CSharpCompilerServer(Func<string, MetadataReferenceProperties, PortableExecutableReference> metadataProvider, string? responseFile, string[] args, BuildPaths buildPaths, string? libDirectory, IAnalyzerAssemblyLoader analyzerLoader, GeneratorDriverCache driverCache) 30internal override Func<string, MetadataReferenceProperties, PortableExecutableReference> GetMetadataProvider()
src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
134protected override PortableExecutableReference WithPropertiesImpl(MetadataReferenceProperties properties)
src\Compilers\Server\VBCSCompiler\VisualBasicCompilerServer.cs (4)
19private readonly Func<string, MetadataReferenceProperties, PortableExecutableReference> _metadataProvider; 21internal VisualBasicCompilerServer(Func<string, MetadataReferenceProperties, PortableExecutableReference> metadataProvider, string[] args, BuildPaths buildPaths, string? libDirectory, IAnalyzerAssemblyLoader analyzerLoader, GeneratorDriverCache driverCache) 26internal VisualBasicCompilerServer(Func<string, MetadataReferenceProperties, PortableExecutableReference> metadataProvider, string? responseFile, string[] args, BuildPaths buildPaths, string? libDirectory, IAnalyzerAssemblyLoader analyzerLoader, GeneratorDriverCache driverCache) 32internal override Func<string, MetadataReferenceProperties, PortableExecutableReference> GetMetadataProvider()