72 references to CreateFromImage
Microsoft.CodeAnalysis (3)
MetadataReference\AssemblyMetadata.cs (1)
129return Create(ModuleMetadata.CreateFromImage(peImage));
MetadataReference\MetadataReference.cs (2)
144/// It is recommended to use <see cref="AssemblyMetadata.CreateFromImage(IEnumerable{byte})"/> or <see cref="ModuleMetadata.CreateFromImage(IEnumerable{byte})"/> 165MetadataImageKind.Module => ModuleMetadata.CreateFromImage(peImage),
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
4501using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, "aa.exe")))) 7090using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, expectedOutputName))))
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
Emit\EmitMetadataTests.cs (2)
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"));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_StructLayout.cs (1)
612using (var module = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.Invalid.ClassLayout))
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Symbols\SymbolErrorTests.cs (3)
25private static readonly ModuleMetadata s_mod1 = ModuleMetadata.CreateFromImage(TestResources.DiagnosticTests.ErrTestMod01); 26private static readonly ModuleMetadata s_mod2 = ModuleMetadata.CreateFromImage(TestResources.DiagnosticTests.ErrTestMod02); 15174var ref1 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.CorLibrary.NoMsCorLibRef).GetReference(display: "NoMsCorLibRef.mod");
Symbols\TypeTests.cs (1)
894var module1Ref = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1).GetReference(display: "netModule1.netmodule");
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
MetadataUtilities.cs (1)
409var metadata = ModuleMetadata.CreateFromImage(GetWindowsProxyBytes());
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 (28)
Mocks\TestReferences.cs (28)
27() => ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleCS00).GetReference(display: "ModuleCS00.mod"), 32() => ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleCS01).GetReference(display: "ModuleCS01.mod"), 37() => ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleVB01).GetReference(display: "ModuleVB01.mod"), 182() => ModuleMetadata.CreateFromImage(TestResources.General.With_SpacesModule).GetReference(display: "With Spaces.netmodule"), 219() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1).GetReference(display: "netModule1.netmodule"), 224() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule2).GetReference(display: "netModule2.netmodule"), 229() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.CrossRefModule1).GetReference(display: "CrossRefModule1.netmodule"), 234() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.CrossRefModule2).GetReference(display: "CrossRefModule2.netmodule"), 240ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.CrossRefLib), 241ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.CrossRefModule1), 242ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.CrossRefModule2)).GetReference(display: "CrossRefLib.dll"), 247() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.hash_module).GetReference(display: "hash_module.netmodule"), 252() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.x64COFF).GetReference(display: "x64COFF.obj"), 270() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.V1.MTTestModule1).GetReference(display: "MTTestModule1.netmodule"), 286() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.V1.MTTestModule2).GetReference(display: "MTTestModule2.netmodule"), 321() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.V2.MTTestModule3).GetReference(display: "MTTestModule3.netmodule"), 356() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.V3.MTTestModule4).GetReference(display: "MTTestModule4.netmodule"), 366ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.MultiModuleDll), 367ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod2), 368ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod3)).GetReference(display: "MultiModule.dll"), 445() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.CustomModifiers.ModifiersModule).GetReference(display: "Modifiers.netmodule"), 529() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.RetargetingCycle.RetV1.ClassB).GetReference(display: "ClassB.netmodule"), 665() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiTargeting.Source1Module).GetReference(display: "Source1Module.netmodule"), 670() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiTargeting.Source3Module).GetReference(display: "Source3Module.netmodule"), 675() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiTargeting.Source4Module).GetReference(display: "Source4Module.netmodule"), 680() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiTargeting.Source5Module).GetReference(display: "Source5Module.netmodule"), 685() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiTargeting.Source7Module).GetReference(display: "Source7Module.netmodule"), 828() => ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1).GetReference(display: "netModule1.netmodule"),
Microsoft.CodeAnalysis.UnitTests (18)
Emit\EmitBaselineTests.cs (1)
24var peModule = ModuleMetadata.CreateFromImage(TestResources.Basic.Members);
MetadataReferences\AssemblyMetadataTests.cs (9)
32var m1 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.MultiModuleDll); 33var m2 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod2); 34var m3 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod3); 77m1 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.MultiModuleDll), 78m2 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod2), 79m3 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod3)); 93m1 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.MultiModuleDll), 94m2 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod2), 95m3 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.MultiModule.mod3));
MetadataReferences\MetadataReferenceTests.cs (3)
256var module = ModuleMetadata.CreateFromImage(TestResources.General.C1); 401var module = ModuleMetadata.CreateFromImage(TestResources.General.C1); 436r = ModuleMetadata.CreateFromImage(TestResources.General.C1).GetReference();
MetadataReferences\ModuleMetadataTests.cs (5)
96Assert.Throws<ArgumentNullException>(() => ModuleMetadata.CreateFromImage(enumerableImage)); 99Assert.Throws<ArgumentNullException>(() => ModuleMetadata.CreateFromImage(arrayImage)); 103ModuleMetadata.CreateFromImage(TestResources.MetadataTests.Invalid.EmptyModuleTable); 132var md = ModuleMetadata.CreateFromImage(Net461.Resources.mscorlib); 141var m = ModuleMetadata.CreateFromImage(Net461.Resources.mscorlib);
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
Attributes\AttributeTests_StructLayout.vb (1)
727Using [module] = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.Invalid.ClassLayout)
Emit\EmitMetadata.vb (2)
293Dim netModule1 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1) 294Dim netModule2 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule2)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
Compilation\CompilationAPITests.vb (3)
1086Dim modRef1 = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleCS00).GetReference() 1172Dim comp = VisualBasicCompilation.Create("Compilation", references:={ModuleMetadata.CreateFromImage(Net461.Resources.System).GetReference()}) 1184Dim modRef1 = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleVB01).GetReference()
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (4)
SymbolsTests\ExtensionMethods\ExtensionMethodTests.vb (2)
1006Dim ILRef = ModuleMetadata.CreateFromImage(File.ReadAllBytes(reference.Path)).GetReference() 2234Dim ILRef = ModuleMetadata.CreateFromImage(File.ReadAllBytes(reference.Path)).GetReference()
SymbolsTests\Metadata\PE\TypeForwarders.vb (1)
1350</compilation>, {ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.TypeForwarders.Forwarded).GetReference(),
SymbolsTests\MetadataFileReferenceCompilationTests.vb (1)
38Dim ref = ModuleMetadata.CreateFromImage({}).GetReference(filePath:="Goo.dll")