Skip to content

Commit

Permalink
Core: DummyDll: Ensure __generated dll has correct ext
Browse files Browse the repository at this point in the history
  • Loading branch information
SamboyCoding committed Jan 29, 2023
1 parent 79f0bdb commit 5cca015
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Cpp2IL.Core/OutputFormats/AsmResolverDummyDllOutputFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ private static AssemblyDefinition BuildStubAssembly(AssemblyAnalysisContext asse
};

//Setting the corlib module allows element types in references to that assembly to be set correctly without us having to manually set them.
var managedModule = new ModuleDefinition(imageDefinition.Name, new(corLib ?? ourAssembly)) //Use either ourself as corlib, if we are corlib, otherwise the provided one
var moduleName = imageDefinition.Name;
if (moduleName == "__Generated")
moduleName += ".dll"; //__Generated doesn't have a .dll extension in the metadata but it is still of course a DLL

var managedModule = new ModuleDefinition(moduleName, new(corLib ?? ourAssembly)) //Use either ourself as corlib, if we are corlib, otherwise the provided one
{
MetadataResolver = metadataResolver
};
Expand Down

0 comments on commit 5cca015

Please sign in to comment.