cecil icon indicating copy to clipboard operation
cecil copied to clipboard

Provide a way to specify the file name of a ModuleDefinition for saving

Open rvaquette opened this issue 14 years ago • 6 comments

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).

rvaquette avatar Jun 24 '10 08:06 rvaquette

Am not sure to get it. You mean that the FullyQualifiedName property is not set when writing a ModuleDefinition?

jbevain avatar Jun 24 '10 09:06 jbevain

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.

rvaquette avatar Jun 24 '10 09:06 rvaquette

So this only applies when writing an assembly with multiple module, and for non main module?

jbevain avatar Jun 24 '10 09:06 jbevain

Yes.

rvaquette avatar Jun 24 '10 09:06 rvaquette

Is there any solution for this case, in order to specify the filename of a non-main module?

rvaquette avatar Aug 09 '10 15:08 rvaquette

No, the bug would be closed otherwise :)

jbevain avatar Aug 09 '10 16:08 jbevain