cecil
cecil copied to clipboard
Provide a way to specify the file name of a ModuleDefinition for saving
The Microsoft Reflection.Emit library allows to specify the filename of a dynamic module, that may be different from its name, but Cecil provide no way to do the same.
(note: the filename is built automatically by Cecil when an assembly with external modules is saved).
Am not sure to get it. You mean that the FullyQualifiedName property is not set when writing a ModuleDefinition?
No, I need a way to provide to Cecil the name of a ModuleDefinition when it needs to save one. See AssemblyWriter.cs, line 942:
var file_name = GetModuleFileName (module.Name); module.Write (file_name, parameters);
In fact I would be happy to have in a ModuleDefinition a property FileName (for example), that could be used instead of the GetModuleFileName method if it is set.
So this only applies when writing an assembly with multiple module, and for non main module?
Yes.
Is there any solution for this case, in order to specify the filename of a non-main module?
No, the bug would be closed otherwise :)