5 instantiations of AssemblyMetadata
Microsoft.CodeAnalysis (5)
MetadataReference\AssemblyMetadata.cs (5)
169return new AssemblyMetadata(manifestModule, moduleName => ModuleMetadata.CreateFromFile(Path.Combine(Path.GetDirectoryName(path) ?? "", moduleName))); 186return new AssemblyMetadata(ImmutableArray.Create(module)); 218return new AssemblyMetadata(modules); 260return new AssemblyMetadata(this, shareCachedSymbols: true); 265return new AssemblyMetadata(this, shareCachedSymbols: false);
461 references to AssemblyMetadata
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
RazorReferenceManager.cs (2)
78var assemblyMetadata = AssemblyMetadata.Create(moduleMetadata);
Microsoft.CodeAnalysis (58)
CommandLine\CommonCompiler.ExistingReferencesResolver.cs (1)
60PEAssembly assembly = ((AssemblyMetadata)peReference.GetMetadataNoCopy()).GetAssembly()!;
Compilation\DeterministicKeyBuilder.cs (1)
296case AssemblyMetadata assemblyMetadata:
DiagnosticAnalyzer\AnalyzerFileReference.cs (2)
225using var assembly = AssemblyMetadata.CreateFromFile(fullPath);
MetadataReader\PEAssembly.cs (3)
51private readonly AssemblyMetadata _owner; 58internal PEAssembly(AssemblyMetadata owner, ImmutableArray<PEModule> modules) 200public AssemblyMetadata GetNonDisposableMetadata() => _owner.Copy();
MetadataReference\AssemblyMetadata.cs (18)
56/// Modules the <see cref="AssemblyMetadata"/> was created with, in case they are eagerly allocated. 76private AssemblyMetadata(AssemblyMetadata other, bool shareCachedSymbols) 114public static AssemblyMetadata CreateFromImage(ImmutableArray<byte> peImage) 127public static AssemblyMetadata CreateFromImage(IEnumerable<byte> peImage) 138public static AssemblyMetadata CreateFromStream(Stream peStream, bool leaveOpen = false) 149public static AssemblyMetadata CreateFromStream(Stream peStream, PEStreamOptions options) 155/// Finds all modules of an assembly on a specified path and builds an instance of <see cref="AssemblyMetadata"/> that represents them. 162public static AssemblyMetadata CreateFromFile(string path) 167internal static AssemblyMetadata CreateFromFile(ModuleMetadata manifestModule, string path) 179public static AssemblyMetadata Create(ModuleMetadata module) 198public static AssemblyMetadata Create(ImmutableArray<ModuleMetadata> modules) 230public static AssemblyMetadata Create(IEnumerable<ModuleMetadata> modules) 243public static AssemblyMetadata Create(params ModuleMetadata[] modules) 249/// Creates a shallow copy of contained modules and wraps them into a new instance of <see cref="AssemblyMetadata"/>. 258internal new AssemblyMetadata Copy() 263internal AssemblyMetadata CopyWithoutSharingCachedSymbols() 296throw new ObjectDisposedException(nameof(AssemblyMetadata)); 362throw new ObjectDisposedException(nameof(AssemblyMetadata));
MetadataReference\MetadataReference.cs (21)
102/// It is recommended to use <see cref="AssemblyMetadata.CreateFromImage(ImmutableArray{byte})"/> or <see cref="ModuleMetadata.CreateFromImage(ImmutableArray{byte})"/> 109/// deterministically use <see cref="AssemblyMetadata.CreateFromImage(ImmutableArray{byte})"/> 111/// <see cref="AssemblyMetadata.GetReference(DocumentationProvider, ImmutableArray{string}, bool, string, string)"/> to get a reference to it. 128_ => AssemblyMetadata.CreateFromImage(peImage), 144/// It is recommended to use <see cref="AssemblyMetadata.CreateFromImage(IEnumerable{byte})"/> or <see cref="ModuleMetadata.CreateFromImage(IEnumerable{byte})"/> 151/// deterministically use <see cref="AssemblyMetadata.CreateFromStream(Stream, PEStreamOptions)"/> 153/// <see cref="AssemblyMetadata.GetReference(DocumentationProvider, ImmutableArray{string}, bool, string, string)"/> to get a reference to it. 166_ => AssemblyMetadata.CreateFromImage(peImage), 186/// It is recommended to use <see cref="AssemblyMetadata.CreateFromStream(Stream, PEStreamOptions)"/> or <see cref="ModuleMetadata.CreateFromStream(Stream, PEStreamOptions)"/> 193/// the lifetime deterministically use <see cref="AssemblyMetadata.CreateFromStream(Stream, PEStreamOptions)"/> 195/// <see cref="AssemblyMetadata.GetReference(DocumentationProvider, ImmutableArray{string}, bool, string, string)"/> 209_ => AssemblyMetadata.CreateFromStream(peStream, PEStreamOptions.PrefetchEntireImage), 228/// It is recommended to use <see cref="AssemblyMetadata.CreateFromFile(string)"/> or <see cref="ModuleMetadata.CreateFromFile(string)"/> 235/// the lifetime deterministically use <see cref="AssemblyMetadata.CreateFromFile(string)"/> 237/// <see cref="AssemblyMetadata.GetReference(DocumentationProvider, ImmutableArray{string}, bool, string, string)"/> 280var assemblyMetadata = AssemblyMetadata.CreateFromFile(module, path); 293/// It is recommended to use <see cref="AssemblyMetadata.CreateFromFile(string)"/> API when creating multiple references to the same assembly. 294/// Reusing <see cref="AssemblyMetadata"/> object allows for sharing data across these references. 321/// It is recommended to use <see cref="AssemblyMetadata.CreateFromFile(string)"/> API when creating multiple references to the same assembly. 322/// Reusing <see cref="AssemblyMetadata"/> object allows for sharing data across these references.
ReferenceManager\CommonReferenceManager.Binding.cs (3)
273out AssemblyMetadata? resolvedAssemblyMetadata, 531[NotNullWhen(true)] out AssemblyMetadata? resolvedAssemblyMetadata, 575AssemblyMetadata assemblyMetadata,
ReferenceManager\CommonReferenceManager.Resolution.cs (6)
329var assemblyMetadata = (AssemblyMetadata)metadata; 494if (newMetadata is AssemblyMetadata assemblyMetadata) 545internal AssemblyMetadata? GetAssemblyMetadata(PortableExecutableReference peReference, DiagnosticBag diagnostics) 556var assemblyMetadata = metadata as AssemblyMetadata;
ReferenceManager\CommonReferenceManager.State.cs (1)
27/// - <see cref="AssemblyMetadata.CachedSymbols"/>
Symbols\IAssemblySymbol.cs (2)
84/// If this symbol represents a metadata assembly returns the underlying <see cref="AssemblyMetadata"/>. 88AssemblyMetadata? GetMetadata();
Microsoft.CodeAnalysis.CSharp (9)
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (1)
102var metadataAssembly = metadataCompilation.GetBoundReferenceManager().CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata.Create(originalMetadata), MetadataImportOptions.All, out assemblyReferenceIdentityMap);
Symbols\AssemblySymbol.cs (2)
1075/// If this symbol represents a metadata assembly returns the underlying <see cref="AssemblyMetadata"/>. 1079public abstract AssemblyMetadata GetMetadata();
Symbols\Metadata\PE\PEAssemblySymbol.cs (1)
304public override AssemblyMetadata GetMetadata() => _assembly.GetNonDisposableMetadata();
Symbols\MissingAssemblySymbol.cs (1)
212public override AssemblyMetadata GetMetadata() => null;
Symbols\PublicModel\AssemblySymbol.cs (1)
50AssemblyMetadata IAssemblySymbol.GetMetadata() => UnderlyingAssemblySymbol.GetMetadata();
Symbols\ReferenceManager.cs (1)
247public PEAssemblySymbol CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata metadata, MetadataImportOptions importOptions, out ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> assemblyReferenceIdentityMap)
Symbols\Retargeting\RetargetingAssemblySymbol.cs (1)
318public override AssemblyMetadata GetMetadata() => _underlyingAssembly.GetMetadata();
Symbols\Source\SourceAssemblySymbol.cs (1)
2942public override AssemblyMetadata GetMetadata() => null;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
CodeActions\AddUsing\AddUsingTests.cs (1)
2052{ "exprs", AssemblyMetadata.CreateFromImage(Net461.Resources.SystemCore).GetReference() }
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
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();
Emit\CompilationEmitTests.cs (1)
894var metadataRef = AssemblyMetadata.CreateFromImage(stream.ToArray()).GetReference();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Emit\EditAndContinue\AssemblyReferencesTests.cs (4)
68var md1 = AssemblyMetadata.CreateFromStream(compilation0.EmitToStream()); 137var md1 = AssemblyMetadata.CreateFromStream(CreateEmptyCompilation(srcPE, parseOptions: parseOptions, references: new[] { MscorlibRef, SystemRef }).EmitToStream());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
Attributes\AttributeTests_Assembly.cs (4)
1107var exeMetadata = AssemblyMetadata.CreateFromImage(consoleappCompilation.EmitToArray()); 1222var exeMetadata = AssemblyMetadata.CreateFromImage(consoleappCompilation.EmitToArray());
Attributes\AttributeTests_MarshalAs.cs (4)
29using (var assembly = AssemblyMetadata.CreateFromImage(verifier.EmittedAssemblyData)) 61using (var assembly = AssemblyMetadata.CreateFromImage(verifier.EmittedAssemblyData))
Attributes\InternalsVisibleToAndStrongNameTests.cs (3)
862references: new[] { AssemblyMetadata.CreateFromStream(otherStream, leaveOpen: true).GetReference() }, 1742using (var metadata = AssemblyMetadata.CreateFromStream(stream))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (9)
Semantics\AccessCheckTests.cs (2)
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");
Semantics\ColorColorTests.cs (4)
1582var refIdentity = ((AssemblyMetadata)ref1.GetMetadataNoCopy()).GetAssembly().Identity.ToString(); 1623var refIdentity = ((AssemblyMetadata)ref1.GetMetadataNoCopy()).GetAssembly().Identity.ToString(); 1661var refIdentity = ((AssemblyMetadata)ref1.GetMetadataNoCopy()).GetAssembly().Identity.ToString(); 1702var refIdentity = ((AssemblyMetadata)ref1.GetMetadataNoCopy()).GetAssembly().Identity.ToString();
Semantics\NamedAndOptionalTests.cs (2)
1348using (var assembly = AssemblyMetadata.CreateFromImage(verifier.EmittedAssemblyData))
Semantics\OverloadResolutionTestBase.cs (1)
30var mscorlibRef = AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib).GetReference(display: "mscorlib");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (43)
Compilation\CompilationAPITests.cs (4)
2201var md1 = AssemblyMetadata.CreateFromImage(CreateCompilation("public class C { }").EmitToArray()); 2202var md2 = AssemblyMetadata.CreateFromImage(CreateCompilation("public class D { }").EmitToArray());
Compilation\ReferenceManagerTests.cs (28)
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"); 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"); 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"); 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"); 1043var ref1 = AssemblyMetadata.CreateFromFile(exe1.Path).GetReference(aliases: ImmutableArray.Create("A1")); 1044var ref2 = AssemblyMetadata.CreateFromFile(exe2.Path).GetReference(aliases: ImmutableArray.Create("A2")); 1126using (AssemblyMetadata metadataLib1 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.W1), 1127metadataLib2 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.W2)) 1161using (AssemblyMetadata metadataLib1 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.W1), 1162metadataLib2 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.WB)) 1191using (AssemblyMetadata metadataLib1 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.WB), 1192metadataLib2 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.WB_Version1)) 1412Assert.Equal(1, ((AssemblyMetadata)refA2.GetMetadataNoCopy()).CachedSymbols.WeakCount); 1645var oldMetadata = AssemblyMetadata.CreateFromImage(CreateCompilation(oldVersion + csharp, assemblyName: "ReachFramework").EmitToArray()); 1762var assemblyMetadata = AssemblyMetadata.CreateFromImage(CreateCompilation("public class TypeDependedOnByModule { }", assemblyName: "lib1").EmitToArray()); 2127var c = CreateCompilation(source, new[] { AssemblyMetadata.CreateFromImage(new byte[0]).GetReference(display: "Empty.dll") }); 2136var md = AssemblyMetadata.CreateFromImage(TestResources.NetFX.Minimal.mincorlib);
Symbols\DefaultInterfaceImplementationTests.cs (1)
62579AssemblyIdentity assemblyIdentity = ((AssemblyMetadata)reference.GetMetadata()).GetAssembly().Identity;
Symbols\Metadata\PE\TypeForwarders.cs (3)
1549var ref1 = AssemblyMetadata.Create(ModuleMetadata.CreateFromImage(bits1), ModuleMetadata.CreateFromImage(bits0)).GetReference(); 1734var assembly1 = AssemblyMetadata.Create(asm1, asm0);
Symbols\MockAssemblySymbol.cs (1)
128public override AssemblyMetadata GetMetadata() => null;
Symbols\Source\ExternAliasTests.cs (2)
215var outputMetadata = AssemblyMetadata.CreateFromImage(comp.EmitToArray());
Symbols\Source\PropertyTests.cs (3)
2609var refData = AssemblyMetadata.CreateFromImage(refComp.EmitToArray()); 2701refData = AssemblyMetadata.CreateFromImage(refComp.EmitToArray());
Symbols\SymbolErrorTests.cs (1)
15031var ref1 = AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1).GetReference(display: "NetModule.mod");
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (3)
CodeGen\WinRTCollectionTests.cs (2)
24AssemblyMetadata.CreateFromImage(TestResources.WinRt.Windows_Languages_WinRTTest).GetReference(display: "WinRTTest"), 25AssemblyMetadata.CreateFromImage(Net461.Resources.SystemCore).GetReference(display: "SystemCore")
Metadata\WinMdMetadataTests.cs (1)
234WinRtRefs.Concat(new[] { AssemblyMetadata.CreateFromImage(TestResources.WinRt.W1).GetReference() }),
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (4)
MetadataUtilities.cs (4)
370var assemblyMetadata = AssemblyMetadata.Create(builder.ToImmutableAndFree()); 413var assemblyMetadata = AssemblyMetadata.Create(builder.ToImmutableAndFree());
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.Scripting (3)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (3)
251newMetadata = AssemblyMetadata.CreateFromFile(fullPath); 447private AssemblyMetadata CreateAssemblyMetadata(FileStream manifestModuleCopyStream, string originalPath, string shadowCopyPath) 481return AssemblyMetadata.Create(modules);
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (6)
MetadataShadowCopyProviderTests.cs (6)
144var metadata1 = _provider.GetMetadata(path0, MetadataImageKind.Assembly) as AssemblyMetadata; 166var metadata2 = _provider.GetMetadata(path0, MetadataImageKind.Assembly) as AssemblyMetadata; 173var modifiedMetadata3 = _provider.GetMetadata(path0, MetadataImageKind.Assembly) as AssemblyMetadata;
Microsoft.CodeAnalysis.Test.Utilities (169)
CommonTestBase.cs (3)
160var assembly = ((AssemblyMetadata)emittedMetadata).GetAssembly(); 167? ((AssemblyMetadata)emittedMetadata).GetReference() 247return AssemblyMetadata.CreateFromImage(assemblyBytes).GetReference(embedInteropTypes: embedInteropTypes);
Compilation\CompilationExtensions.cs (1)
136return AssemblyMetadata.CreateFromImage(image).GetReference(aliases: aliases, embedInteropTypes: embedInteropTypes, display: comp.MakeSourceAssemblySimpleName());
Compilation\IRuntimeEnvironment.cs (2)
87return (metadata.Kind == MetadataImageKind.Assembly) ? ((AssemblyMetadata)metadata).GetModules().AsEnumerable() : SpecializedCollections.SingletonEnumerable((ModuleMetadata)metadata); 107? ((AssemblyMetadata)metadata).GetAssembly().Identity
Compilation\MetadataReferenceExtensions.cs (1)
32case AssemblyMetadata assemblyMetadata:
CompilationVerifier.cs (2)
84return AssemblyMetadata.Create(images.Select(image => 722return AssemblyMetadata.Create(moduleMetadata).GetReference(display: display);
Mocks\TestMetadataReference.cs (1)
87return AssemblyMetadata.CreateFromImage(_metadataBytes);
Mocks\TestReferences.cs (123)
22() => AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.AppCS).GetReference(display: "AppCS"), 45() => AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.InterfaceAndClass.CSClasses01).GetReference(display: "CSClasses01.dll"), 50() => AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.InterfaceAndClass.CSInterfaces01).GetReference(display: "CSInterfaces01.dll"), 55() => AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.InterfaceAndClass.VBClasses01).GetReference(display: "VBClasses01.dll"), 60() => AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.InterfaceAndClass.VBClasses02).GetReference(display: "VBClasses02.dll"), 65() => AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.InterfaceAndClass.VBInterfaces01).GetReference(display: "VBInterfaces01.dll"), 76() => AssemblyMetadata.CreateFromImage(TestResources.NetFX.Minimal.mincorlib).GetReference(display: "mincorlib.dll"), 81() => AssemblyMetadata.CreateFromImage(TestResources.NetFX.Minimal.minasync).GetReference(display: "minasync.dll"), 86() => AssemblyMetadata.CreateFromImage(TestResources.NetFX.Minimal.minasynccorlib).GetReference(display: "minasynccorlib.dll"), 94() => AssemblyMetadata.CreateFromImage(TestResources.NetFX.ValueTuple.tuplelib).GetReference(display: "System.ValueTuple.dll"), 102() => AssemblyMetadata.CreateFromImage(Silverlight.System).GetReference(display: "System.v5.0.5.0_silverlight.dll"), 113() => AssemblyMetadata.CreateFromImage(TestResources.DiagnosticTests.ErrTestLib01).GetReference(display: "ErrTestLib01.dll"), 121() => AssemblyMetadata.CreateFromImage(TestResources.DiagnosticTests.ErrTestLib02).GetReference(display: "ErrTestLib02.dll"), 129() => AssemblyMetadata.CreateFromImage(TestResources.DiagnosticTests.ErrTestLib11).GetReference(display: "ErrTestLib11.dll"), 137() => AssemblyMetadata.CreateFromImage(TestResources.DiagnosticTests.ErrTestMod01).GetReference(display: "ErrTestMod01.dll"), 145() => AssemblyMetadata.CreateFromImage(TestResources.DiagnosticTests.ErrTestMod02).GetReference(display: "ErrTestMod02.dll"), 153() => AssemblyMetadata.CreateFromImage(TestResources.DiagnosticTests.badresfile).GetReference(display: "badresfile.res"), 162() => AssemblyMetadata.CreateFromImage(TestResources.General.MDTestLib1).GetReference(display: "MDTestLib1.dll"), 167() => AssemblyMetadata.CreateFromImage(TestResources.General.MDTestLib2).GetReference(display: "MDTestLib2.dll"), 172() => AssemblyMetadata.CreateFromImage(TestResources.General.VBConversions).GetReference(display: "VBConversions.dll"), 177() => AssemblyMetadata.CreateFromImage(TestResources.General.With_Spaces).GetReference(display: "With Spaces.dll"), 187() => AssemblyMetadata.CreateFromImage(TestResources.General.InheritIComparable).GetReference(display: "InheritIComparable.dll"), 192() => AssemblyMetadata.CreateFromImage(TestResources.General.BigVisitor).GetReference(display: "BigVisitor.dll"), 197() => AssemblyMetadata.CreateFromImage(TestResources.General.Properties).GetReference(display: "Properties.dll"), 202() => AssemblyMetadata.CreateFromImage(TestResources.General.PropertiesWithByRef).GetReference(display: "PropertiesWithByRef.dll"), 207() => AssemblyMetadata.CreateFromImage(TestResources.General.Indexers).GetReference(display: "Indexers.dll"), 212() => AssemblyMetadata.CreateFromImage(TestResources.General.Events).GetReference(display: "Events.dll"), 239() => AssemblyMetadata.Create( 262() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.V1.MTTestLib1).GetReference(display: "MTTestLib1.dll"), 278() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.V1.MTTestLib2).GetReference(display: "MTTestLib2.dll"), 297() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.V2.MTTestLib1).GetReference(display: "MTTestLib1.dll"), 305() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.V2.MTTestModule1).GetReference(display: "MTTestModule1.netmodule"), 313() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.V2.MTTestLib3).GetReference(display: "MTTestLib3.dll"), 332() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.V3.MTTestLib1).GetReference(display: "MTTestLib1.dll"), 340() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.V3.MTTestModule1).GetReference(display: "MTTestModule1.netmodule"), 348() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.V3.MTTestLib4).GetReference(display: "MTTestLib4.dll"), 365() => AssemblyMetadata.Create( 373() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod2).GetReference(display: "mod2.netmodule"), 378() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod3).GetReference(display: "mod3.netmodule"), 383() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.Consumer).GetReference(display: "Consumer.dll"), 391() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.DifferByCase.TypeAndNamespaceDifferByCase).GetReference(display: "TypeAndNamespaceDifferByCase.dll"), 396() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.DifferByCase.Consumer).GetReference(display: "Consumer.dll"), 401() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.DifferByCase.Consumer).GetReference(display: "CsharpCaseSen.dll"), 406() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.DifferByCase.CSharpDifferCaseOverloads).GetReference(display: "CSharpDifferCaseOverloads.dll"), 416() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CorLibrary.GuidTest2).GetReference(display: "GuidTest2.exe"), 422() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CorLibrary.NoMsCorLibRef).GetReference(display: "NoMsCorLibRef.dll"), 429() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CorLibrary.FakeMsCorLib).GetReference(display: "FakeMsCorLib.dll"), 440() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CustomModifiers.Modifiers).GetReference(display: "Modifiers.dll"), 451() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CustomModifiers.ModoptTests).GetReference(display: "ModoptTests.dll"), 458() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CustomModifiers.CppCli).GetReference(display: "CppCli.dll"), 466() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CustomModifiers.GenericMethodWithModifiers).GetReference(display: "GenericMethodWithModifiers.dll"), 477() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Cyclic.Cyclic1).GetReference(display: "Cyclic1.dll"), 485() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Cyclic.Cyclic2).GetReference(display: "Cyclic2.dll"), 494() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CyclicInheritance.Class1).GetReference(display: "Class1.dll"), 499() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CyclicInheritance.Class2).GetReference(display: "Class2.dll"), 504() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CyclicInheritance.Class3).GetReference(display: "Class3.dll"), 510() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.CyclicStructure.cycledstructs).GetReference(display: "cycledstructs.dll"), 521() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.RetargetingCycle.RetV1.ClassA).GetReference(display: "ClassA.dll"), 540() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.RetargetingCycle.RetV2.ClassA).GetReference(display: "ClassA.dll"), 548() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.RetargetingCycle.RetV2.ClassB).GetReference(display: "ClassB.dll"), 558() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Methods.CSMethods).GetReference(display: "CSMethods.Dll"), 563() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Methods.VBMethods).GetReference(display: "VBMethods.Dll"), 568() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Methods.ILMethods).GetReference(display: "ILMethods.Dll"), 573() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Methods.ByRefReturn).GetReference(display: "ByRefReturn.Dll"), 583() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Fields.CSFields).GetReference(display: "CSFields.Dll"), 591() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Fields.VBFields).GetReference(display: "VBFields.Dll"), 597() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Fields.ConstantFields).GetReference(display: "ConstantFields.Dll"), 605() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MissingTypes.MDMissingType).GetReference(display: "MDMissingType.Dll"), 610() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MissingTypes.MDMissingTypeLib).GetReference(display: "MDMissingTypeLib.Dll"), 615() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MissingTypes.MissingTypesEquality1).GetReference(display: "MissingTypesEquality1.Dll"), 620() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MissingTypes.MissingTypesEquality2).GetReference(display: "MissingTypesEquality2.Dll"), 625() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MissingTypes.CL2).GetReference(display: "CL2.Dll"), 630() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MissingTypes.CL3).GetReference(display: "CL3.Dll"), 640() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.TypeForwarders.TypeForwarder).GetReference(display: "TypeForwarder.Dll"), 648() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.TypeForwarders.TypeForwarderLib).GetReference(display: "TypeForwarderLib.Dll"), 656() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.TypeForwarders.TypeForwarderBase).GetReference(display: "TypeForwarderBase.Dll"), 701() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.Pia1).GetReference(display: "Pia1.dll"), 706() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.Pia1Copy).GetReference(display: "Pia1Copy.dll"), 711() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.Pia2).GetReference(display: "Pia2.dll"), 716() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.Pia3).GetReference(display: "Pia3.dll"), 721() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.Pia4).GetReference(display: "Pia4.dll"), 726() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.Pia5).GetReference(display: "Pia5.dll"), 731() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.GeneralPia).GetReference(display: "GeneralPia.dll"), 736() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.GeneralPiaCopy).GetReference(display: "GeneralPiaCopy.dll"), 741() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.NoPIAGenerics1_Asm1).GetReference(display: "NoPIAGenerics1-Asm1.dll"), 746() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.ExternalAsm1).GetReference(display: "ExternalAsm1.dll"), 751() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.Library1).GetReference(display: "Library1.dll"), 756() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.Library2).GetReference(display: "Library2.dll"), 761() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.LocalTypes1).GetReference(display: "LocalTypes1.dll"), 766() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.LocalTypes2).GetReference(display: "LocalTypes2.dll"), 771() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.LocalTypes3).GetReference(display: "LocalTypes3.dll"), 776() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.A).GetReference(display: "A.dll"), 781() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.B).GetReference(display: "B.dll"), 786() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.C).GetReference(display: "C.dll"), 791() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.D).GetReference(display: "D.dll"), 800() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.MissingPIAAttributes).GetReference(display: "MicrosoftPIAAttributes.dll"), 810() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Interface.StaticMethodInInterface).GetReference(display: "StaticMethodInInterface.dll"), 815() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Interface.MDInterfaceMapping).GetReference(display: "MDInterfaceMapping.dll"), 823() => AssemblyMetadata.CreateFromImage(TestResources.General.MDTestLib1).GetReference(display: "MDTestLib1.dll"), 838() => AssemblyMetadata.CreateFromImage(TestResources.General.CSharpExplicitInterfaceImplementation).GetReference(display: "CSharpExplicitInterfaceImplementation.dll"), 843() => AssemblyMetadata.CreateFromImage(TestResources.General.ILExplicitInterfaceImplementation).GetReference(display: "ILExplicitInterfaceImplementation.dll"), 851() => AssemblyMetadata.CreateFromImage(TestResources.General.CSharpExplicitInterfaceImplementationProperties).GetReference(display: "CSharpExplicitInterfaceImplementationProperties.dll"), 856() => AssemblyMetadata.CreateFromImage(TestResources.General.ILExplicitInterfaceImplementationProperties).GetReference(display: "ILExplicitInterfaceImplementationProperties.dll"), 864() => AssemblyMetadata.CreateFromImage(TestResources.General.CSharpExplicitInterfaceImplementationEvents).GetReference(display: "CSharpExplicitInterfaceImplementationEvents.dll"), 871() => AssemblyMetadata.CreateFromImage(TestResources.General.Regress40025DLL).GetReference(display: "Regress40025DLL.dll"), 878() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.WithEvents.SimpleWithEvents).GetReference(display: "SimpleWithEvents.dll"), 886() => AssemblyMetadata.CreateFromImage(TestResources.General.DelegatesWithoutInvoke).GetReference(display: "DelegatesWithoutInvoke.dll"), 891() => AssemblyMetadata.CreateFromImage(TestResources.General.DelegateByRefParamArray).GetReference(display: "DelegateByRefParamArray.dll"), 899() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.InvalidCharactersInAssemblyName).GetReference(display: "InvalidCharactersInAssemblyName.dll"), 904() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.MDTestAttributeDefLib).GetReference(display: "MDTestAttributeDefLib.dll"), 909() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.MDTestAttributeApplicationLib).GetReference(display: "MDTestAttributeApplicationLib.dll"), 914() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.AttributeInterop01).GetReference(display: "AttributeInterop01.dll"), 919() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.AttributeInterop02).GetReference(display: "AttributeInterop02.dll"), 924() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.AttributeTestLib01).GetReference(display: "AttributeTestLib01.dll"), 929() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.AttributeTestDef01).GetReference(display: "AttributeTestDef01.dll"), 934() => AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.DynamicAttribute).GetReference(display: "DynamicAttribute.dll"), 942() => AssemblyMetadata.CreateFromImage(TestResources.General.Unavailable).GetReference(display: "Unavailable.dll"), 947() => AssemblyMetadata.CreateFromImage(TestResources.General.CSharpErrors).GetReference(display: "CSharpErrors.dll"), 952() => AssemblyMetadata.CreateFromImage(TestResources.General.ILErrors).GetReference(display: "ILErrors.dll"), 960() => AssemblyMetadata.CreateFromImage(TestResources.General.Culture_AR_SA).GetReference(display: "AR-SA"), 965() => AssemblyMetadata.CreateFromImage(TestResources.General.Culture_EN_US).GetReference(display: "EN-US"), 970() => AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(display: "C1"), 975() => AssemblyMetadata.CreateFromImage(TestResources.General.C2).GetReference(display: "C2"),
PDB\TestMetadataReferenceInfo.cs (2)
56var metadata = AssemblyMetadata.CreateFromStream(emitStream);
TargetFrameworkUtil.cs (1)
380p.GetMetadata() is AssemblyMetadata assemblyMetadata)
TestBase.cs (33)
102var winmd = AssemblyMetadata.CreateFromImage(TestResources.WinRt.Windows).GetReference(display: "Windows"); 105AssemblyMetadata.CreateFromImage(TestResources.NetFX.WinRt.SystemRuntimeWindowsRuntime).GetReference(display: "System.Runtime.WindowsRuntime.dll"); 108AssemblyMetadata.CreateFromImage(Net461.Resources.SystemRuntime).GetReference(display: "System.Runtime.dll"); 111AssemblyMetadata.CreateFromImage(Net461.Resources.SystemObjectModel).GetReference(display: "System.ObjectModel.dll"); 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"); 149() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemCore).GetReference(display: "System.Core.v4_0_30319.dll"), 154() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemCore).GetReference(display: "System.Core.v4_0_30319_17929.dll"), 159() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemRuntimeSerialization).GetReference(display: "System.Runtime.Serialization.v4_0_30319_17929.dll"), 164() => AssemblyMetadata.CreateFromImage(Net461.ReferenceInfos.SystemCore.ImageBytes).GetReference(display: "System.Core.v4_6_1038_0.dll"), 169() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemWindowsForms).GetReference(display: "System.Windows.Forms.v4_0_30319.dll"), 174() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemDrawing).GetReference(display: "System.Drawing.v4_0_30319.dll"), 179() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemData).GetReference(display: "System.Data.v4_0_30319.dll"), 184() => AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib).GetReference(display: "mscorlib.v4_0_30319.dll"), 206return AssemblyMetadata.CreateFromStream(dllStream).GetReference(display: "mscorlib.v4_0_30319.dll"); 216() => AssemblyMetadata.CreateFromImage(Net461.ReferenceInfos.mscorlib.ImageBytes).GetReference(display: "mscorlib.v4_6_1038_0.dll", filePath: @"Z:\FxReferenceAssembliesUri"), 246() => AssemblyMetadata.CreateFromImage(Net461.Resources.MicrosoftCSharp).GetReference(display: "Microsoft.CSharp.v4.0.30319.dll"), 251() => AssemblyMetadata.CreateFromImage(NetStandard20.Resources.netstandard).GetReference(display: "netstandard20.netstandard.dll"), 257() => AssemblyMetadata.CreateFromImage(Net461.Resources.System).GetReference(display: "System.v4_0_30319.dll"), 262() => AssemblyMetadata.CreateFromImage(Net461.ReferenceInfos.System.ImageBytes).GetReference(display: "System.v4_6_1038_0.dll"), 267() => AssemblyMetadata.CreateFromImage(Net461.Resources.System).GetReference(display: "System.v4_0_30319_17929.dll"), 272() => AssemblyMetadata.CreateFromImage(Net20.Resources.System).GetReference(display: "System.v2_0_50727.dll"), 277() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemXml).GetReference(display: "System.Xml.v4_0_30319.dll"), 282() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemXmlLinq).GetReference(display: "System.Xml.Linq.v4_0_30319.dll"), 287() => AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib).GetReference(display: "mscorlib.dll"), 292() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemRuntime).GetReference(display: "System.Runtime.dll"), 297() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemThreading).GetReference(display: "System.Threading.dll"), 302() => AssemblyMetadata.CreateFromImage(Net461.Resources.SystemThreadingTasks).GetReference(display: "System.Threading.Tasks.dll"), 307() => AssemblyMetadata.CreateFromImage(TestResources.NetFX.PortableProfile7.Mscorlib).GetReference(display: "mscorlib.dll"), 312() => AssemblyMetadata.CreateFromImage(TestResources.NetFX.PortableProfile7.SystemRuntime).GetReference(display: "System.Runtime.dll"), 317() => AssemblyMetadata.CreateFromImage(TestResources.General.FSharpTestLibrary).GetReference(display: "FSharpTestLibrary.dll"),
Microsoft.CodeAnalysis.UnitTests (45)
MetadataReferences\AssemblyMetadataTests.cs (23)
20Assert.Throws<ArgumentNullException>(() => AssemblyMetadata.CreateFromImage(default(ImmutableArray<byte>))); 23Assert.Throws<ArgumentNullException>(() => AssemblyMetadata.CreateFromImage(enumerableImage)); 26Assert.Throws<ArgumentNullException>(() => AssemblyMetadata.CreateFromImage(arrayImage)); 28Assert.Throws<ArgumentNullException>(() => AssemblyMetadata.Create((ModuleMetadata)null)); 29Assert.Throws<ArgumentException>(() => AssemblyMetadata.Create(default(ImmutableArray<ModuleMetadata>))); 30Assert.Throws<ArgumentException>(() => AssemblyMetadata.Create(ImmutableArray.Create<ModuleMetadata>())); 36Assert.Throws<ArgumentException>(() => AssemblyMetadata.Create(m1, m2.Copy(), m3)); 37Assert.Throws<ArgumentException>(() => AssemblyMetadata.Create(new List<ModuleMetadata>(new ModuleMetadata[] { m1.Copy(), m2.Copy(), m3.Copy() }))); 38Assert.Throws<ArgumentNullException>(() => AssemblyMetadata.Create(ImmutableArray.Create(m1, m2, null))); 39Assert.Throws<ArgumentNullException>(() => AssemblyMetadata.Create(ImmutableArray.Create((ModuleMetadata)null))); 41Assert.Throws<ArgumentNullException>(() => AssemblyMetadata.CreateFromFile((string)null)); 47using (var a = AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.MultiModuleDll)) 63using (var a = AssemblyMetadata.CreateFromFile(mm)) 76var md = AssemblyMetadata.Create( 92var a = AssemblyMetadata.Create( 142var metadata = AssemblyMetadata.CreateFromFile(invalidModuleName.Path); 149var metadata = AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.Invalid.IncorrectCustomAssemblyTableSize_TooManyMethodSpecs);
MetadataReferences\MetadataReferenceTests.cs (18)
68Assert.IsAssignableFrom<AssemblyMetadata>(r.GetMetadata()); 111var metadata = (AssemblyMetadata)r.GetMetadataNoCopy(); 122((AssemblyMetadata)r.GetMetadataNoCopy()).GetAssembly().Identity.GetDisplayName()); 133Assert.IsAssignableFrom<AssemblyMetadata>(r.GetMetadata()); 165Assert.IsAssignableFrom<AssemblyMetadata>(r.GetMetadata()); 177var metadata = (AssemblyMetadata)r.GetMetadataNoCopy(); 288var assembly = AssemblyMetadata.CreateFromImage(TestResources.General.C1); 416var assembly = AssemblyMetadata.CreateFromImage(TestResources.General.C1); 442r = AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(display: @"dddd"); 445r = AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(filePath: @"c:\blah", display: @"dddd"); 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). 587Assert.Throws<BadImageFormatException>((Func<object>)((AssemblyMetadata)r.GetMetadataNoCopy()).GetAssembly);
MetadataReferences\ModuleNoPiaTests.cs (4)
17using (AssemblyMetadata piaMetadata = AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.Pia1), 18metadata1 = AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.LocalTypes1), 19metadata2 = AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.LocalTypes2))
Microsoft.CodeAnalysis.VisualBasic (10)
CommandLine\VisualBasicCommandLineArguments.vb (1)
88Dim assemblyMetadata = TryCast(DirectCast(reference, PortableExecutableReference).GetMetadataNoCopy(), AssemblyMetadata)
CommandLine\VisualBasicCommandLineParser.vb (1)
1551Using metadata = AssemblyMetadata.CreateFromFile(systemRuntimePath)
Emit\EditAndContinue\PEDeltaAssemblyBuilder.vb (1)
107Dim metadataAssembly = metadataCompilation.GetBoundReferenceManager().CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata.Create(originalMetadata), MetadataImportOptions.All, assemblyReferenceIdentityMap)
Symbols\AssemblySymbol.vb (2)
92''' If this symbol represents a metadata assembly returns the underlying <see cref="AssemblyMetadata"/>. 96Public MustOverride Function GetMetadata() As AssemblyMetadata Implements IAssemblySymbol.GetMetadata
Symbols\Metadata\PE\PEAssemblySymbol.vb (1)
278Public Overrides Function GetMetadata() As AssemblyMetadata
Symbols\MissingAssemblySymbol.vb (1)
177Public Overrides Function GetMetadata() As AssemblyMetadata
Symbols\ReferenceManager.vb (1)
209Friend Function CreatePEAssemblyForAssemblyMetadata(metadata As AssemblyMetadata, importOptions As MetadataImportOptions, <Out> ByRef assemblyReferenceIdentityMap As ImmutableDictionary(Of AssemblyIdentity, AssemblyIdentity)) As PEAssemblySymbol
Symbols\Retargeting\RetargetingAssemblySymbol.vb (1)
280Public Overrides Function GetMetadata() As AssemblyMetadata
Symbols\Source\SourceAssemblySymbol.vb (1)
1811Public Overrides Function GetMetadata() As AssemblyMetadata
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (18)
Attributes\AssemblyAttributes.vb (2)
1332metadata = AssemblyMetadata.CreateFromImage(consoleappCompilation.EmitToArray()).GetAssembly.ManifestModule 1443metadata = AssemblyMetadata.CreateFromImage(consoleappCompilation.EmitToArray()).GetAssembly.ManifestModule
Attributes\AttributeTests_MarshalAs.vb (2)
25Using assembly = AssemblyMetadata.CreateFromImage(verifier.EmittedAssemblyData) 47Using assembly = AssemblyMetadata.CreateFromImage(verifier.EmittedAssemblyData)
CodeGen\CodeGenTests.vb (1)
13657Dim testReference = AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.Metadata.BadDefaultParameterValue).GetReference()
CodeGen\WinRTCollectionTests.vb (2)
21listRefs.Add(AssemblyMetadata.CreateFromImage(TestResources.WinRt.Windows_Languages_WinRTTest).GetReference(display:="WinRTTest")) 22listRefs.Add(AssemblyMetadata.CreateFromImage(Net461.Resources.SystemCore).GetReference(display:="SystemCore"))
Emit\CompilationEmitTests.vb (1)
649Dim metadataRef = AssemblyMetadata.CreateFromImage(stream.ToArray()).GetReference()
Emit\EditAndContinue\EditAndContinueTests.vb (2)
1321Dim referencePIA = AssemblyMetadata.CreateFromImage(compilationPIA.EmitToArray()).GetReference(embedInteropTypes:=True) 5765Dim moduleMetadata0 = DirectCast(metadata0.GetMetadataNoCopy(), AssemblyMetadata).GetModules(0)
Emit\EmitMetadata.vb (3)
249Using metadata = AssemblyMetadata.CreateFromImage(dllImage) 275Using metadata = AssemblyMetadata.CreateFromImage(dllImage) 313Using metadata = AssemblyMetadata.Create(ModuleMetadata.CreateFromImage(manifestModule), netModule1, netModule2)
Emit\NoPiaEmbedTypes.vb (5)
106references:={AssemblyMetadata.CreateFromImage(compilation1.EmitToArray()).GetReference(embedInteropTypes:=False)}) 111references:={AssemblyMetadata.CreateFromImage(compilation1.EmitToArray()).GetReference(embedInteropTypes:=True)}) 210references:={AssemblyMetadata.CreateFromImage(compilation1.EmitToArray()).GetReference(embedInteropTypes:=True)}) 275references:={AssemblyMetadata.CreateFromImage(compilation1.EmitToArray()).GetReference(embedInteropTypes:=True)}) 4537AssemblyMetadata.CreateFromImage(TestResources.SymbolsTests.NoPia.ParametersWithoutNames).
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (1)
ScriptTests.vb (1)
22Private Shared ReadOnly s_msvbReference As PortableExecutableReference = AssemblyMetadata.CreateFromImage(Net461.Resources.MicrosoftVisualBasic).GetReference()
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (22)
Binding\LookupTests.vb (1)
944Dim nonSharedMscorlibReference = AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib).GetReference(display:="mscorlib.v4_0_30319.dll")
Compilation\CompilationAPITests.vb (3)
1166Dim comp = VisualBasicCompilation.Create("Compilation", references:={AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleVB01).GetReference()}) 2446Dim md1 = AssemblyMetadata.CreateFromImage(CreateCompilationWithMscorlib40({"Public Class C : End Class"}, options:=TestOptions.ReleaseDll).EmitToArray()) 2447Dim md2 = AssemblyMetadata.CreateFromImage(CreateCompilationWithMscorlib40({"Public Class D : End Class"}, options:=TestOptions.ReleaseDll).EmitToArray())
Compilation\ReferenceManagerTests.vb (18)
671Dim r1 = AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(filePath:="c:\temp\a.dll", display:="R1") 672Dim r2 = AssemblyMetadata.CreateFromImage(TestResources.General.C1).GetReference(filePath:="c:\temp\a.dll", display:="R2") 784AssemblyMetadata.CreateFromImage(imageRefLibV1).GetReference(), 785AssemblyMetadata.CreateFromImage(imageRefLibV1).GetReference(display:="MyBytesAssembly1")}) 910Using metadataLib1 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.W1.AsImmutable()), 911metadataLib2 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.W2.AsImmutable()) 945Using metadataLib1 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.W1.AsImmutable()), 946metadataLib2 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.WB.AsImmutable()) 976Using metadataLib1 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.WB.AsImmutable()), 977metadataLib2 = AssemblyMetadata.CreateFromImage(TestResources.WinRt.WB_Version1.AsImmutable()) 1048Dim refB = AssemblyMetadata.CreateFromImage(b.EmitToArray()).GetReference(display:="B") 1062Dim refA2 = AssemblyMetadata.CreateFromImage(a2.EmitToArray()).GetReference(display:="A2") 1080Assert.Equal(1, (DirectCast(refA2.GetMetadataNoCopy(), AssemblyMetadata)).CachedSymbols.WeakCount) 1456Dim assemblyMd = AssemblyMetadata.CreateFromImage(CreateCompilationWithMscorlib40(assemblySource).EmitToArray()) 1610Dim refa = AssemblyMetadata.CreateFromImage(a.EmitToArray()).GetReference(display:="A") 1612Dim refmetadata = DirectCast(refa.GetMetadataNoCopy(), AssemblyMetadata) 1644Dim c = CreateCompilationWithMscorlib40AndReferences(source, {AssemblyMetadata.CreateFromImage({}).GetReference(display:="Empty.dll")}, TestOptions.ReleaseDll) 1651Dim md = AssemblyMetadata.CreateFromImage(TestResources.NetFX.Minimal.mincorlib)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (9)
SymbolsTests\Metadata\PE\HasUnsupportedMetadata.vb (4)
445Dim ref1 = AssemblyMetadata.CreateFromImage(bytes1).GetReference() 472Dim ref2 = AssemblyMetadata.CreateFromImage(ReplaceBytes(bytes2, validAssemblyRefTypeRef, invalidAssemblyRefTypeRef)).GetReference() 485ref2 = AssemblyMetadata.CreateFromImage(ReplaceBytes(bytes2, validAssemblyRefTypeRef, invalidModuleRefTypeRef)).GetReference() 498ref2 = AssemblyMetadata.CreateFromImage(ReplaceBytes(bytes2, validAssemblyRefTypeRef, invalidTypeRefTypeRef)).GetReference()
SymbolsTests\Metadata\WinMdTypeTests.vb (1)
68Dim comp = CreateCompilationWithWinRt(source).AddReferences(AssemblyMetadata.CreateFromImage(TestResources.WinRt.W1).GetReference())
SymbolsTests\MetadataFileReferenceCompilationTests.vb (4)
60Dim mscorlibMetadata = AssemblyMetadata.CreateFromImage(Net461.Resources.mscorlib) 86Dim metadata1 = AssemblyMetadata.CreateFromImage(TestResources.General.C1) 87Dim metadata2 = AssemblyMetadata.CreateFromImage(TestResources.General.C2) 102Dim metadata3 = AssemblyMetadata.CreateFromImage(b.EmitToArray())
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
MockSymbols.vb (1)
885Public Overrides Function GetMetadata() As AssemblyMetadata
Microsoft.CodeAnalysis.Workspaces (12)
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (1)
276if (metadata is AssemblyMetadata assembly)
Serialization\SerializedPortableExecutableReference.cs (2)
65MetadataKind={metadata switch { null => "null", AssemblyMetadata => "assembly", ModuleMetadata => "module", _ => metadata.GetType().Name }} 71if (metadata is AssemblyMetadata assemblyMetadata)
Serialization\SerializerService_Reference.cs (4)
214if (metadata is AssemblyMetadata assemblyMetadata) 233private static bool TryGetModules(AssemblyMetadata assemblyMetadata, out ImmutableArray<ModuleMetadata> modules) 330if (metadata is AssemblyMetadata assemblyMetadata) 401return (AssemblyMetadata.Create(allMetadata.MoveToImmutable()), allHandles.MoveToImmutable());
Workspace\Host\TemporaryStorage\ITemporaryStorageService.cs (1)
37/// their data into types like <see cref="AssemblyMetadata"/>. It also allows them to be read in by our server
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (3)
233(AssemblyMetadata? metadata, ITemporaryStorageStreamHandle storageHandle) TryCreateMetadataAndHandle() 262var result = AssemblyMetadata.CreateFromStream(
Workspace\Solution\SolutionCompilationState.SkeletonReferenceSet.cs (1)
21AssemblyMetadata metadata,
Microsoft.VisualStudio.LanguageServices (13)
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (13)
39/// Mapping from an <see cref="AssemblyMetadata"/> we created, to the identifiers identifying the memory mapped 45private static readonly ConditionalWeakTable<AssemblyMetadata, IReadOnlyList<TemporaryStorageStreamHandle>> s_metadataToStorageHandles = new(); 55private readonly Dictionary<string, (DateTime lastWriteTime, AssemblyMetadata metadata)> _metadataCache = new(StringComparer.OrdinalIgnoreCase); 95private bool TryGetMetadata(string filePath, DateTime lastWriteTime, [NotNullWhen(true)] out AssemblyMetadata? metadata) 113if (TryGetMetadata(fullPath, snapshotTimestamp, out var metadata) && 153if (!TryGetMetadata(fullPath, snapshotTimestamp, out var metadata)) 164if (TryGetMetadata(fullPath, snapshotTimestamp, out var cachedMetadata)) 178AssemblyMetadata GetMetadataWorker(string fullPath) 268private (AssemblyMetadata assemblyMetadata, IReadOnlyList<TemporaryStorageStreamHandle>? handles) CreateAssemblyMetadataFromMetadataImporter(string fullPath) 328private static (AssemblyMetadata assemblyMetadata, IReadOnlyList<TemporaryStorageStreamHandle>? handles) CreateAssemblyMetadata( 354var assembly = AssemblyMetadata.Create(modules.MoveToImmutable()); 365public static (AssemblyMetadata assemblyMetadata, IReadOnlyList<TemporaryStorageStreamHandle>? handles) CreateAssemblyMetadata(
VBCSCompiler (1)
src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
80Metadata result = AssemblyMetadata.Create(allModules);