ModuleDefinition.Assembly is null in multi-module assemblies #652
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I am not sure whether this qualifies as a bug or is it intentional.
ModuleDefinition.Assemblyproperty inAssemblyDefinition.Modulesisnullfor modules which are not defined in the same dll as the assembly. Given that the the assembly definition always creates new instances of module definitions it would make sense to keep the link back to the assembly.The problem with current situation is that currently there is no way to associate TypeDefinitions in such auxiliary modules back to the assembly they were defined in.
Thanks for your hard work!
I think the original intent was that there's no Assembly row in a multi-module assembly.
So in theory, a multi module assembly could even belong to 2 assemblies.
Also I like to pretend that multi-module don't really exist :)
I think the way to go would be:
If you use
AssemblyDefinition.ReadAssemblyon a multi-module assembly, the.Assemblyproperty should return the main assembly.If you use
ModuleDefinition.ReadModuleon a.netmodule, the.Assemblyproperty should return null.Fixed by #730