Closed chuckbeasley closed 8 years ago
@chuckbeasley hey Chuck, can you upload the assembly somewhere? Thanks!
@jbevain Hey JB. Check your inbox.
@chuckbeasley got it thanks, it might be a while before I get to it.
@jbevain cool! anyplace you recommend I start looking?
Should be fixed in 15ba007af7d639821784b7b6c3648836ef197165
I load an assembly as follows: AssemblyDefinition asm2 = MetadataMapper.MapAssembly(AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName == "Ats.OpenOne.Web.Controllers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null").First());
That part works fine. Next, I write the DLL out to a file, as follows: asm2.Write(@"C:\Source\Workspace\Ats.OpenOne\artifacts\bin\" + projectNames[10] + @"\Debug\dnx451\" + projectNames[10] + "_.dll");
When I attempt to load the assembly into memory, I get a LoaderException upon hitting this code: Assembly onDiskAssembly2 = Assembly.LoadFile(@"C:\Source\Workspace\Ats.OpenOne\artifacts\bin\" + projectNames[10] + @"\Debug\dnx451\" + projectNames[10] + "_.dll");
I've researched into this and the main difference I see is MetadataSystem is null, but is populated when I load a DLL written by Mono Cecil from disk.