[Mono-dev] mkbundle & Assembly.GetEntryAssembly()

Robert Jordan robertj at gmx.net
Tue May 16 03:31:16 UTC 2017

On 16.05.2017 01:48, Rick Tillery wrote:
> Thanks! That looks like it might work in C# (we don't really have any C 
> in this project). I'll give it a try.
> However, I respectfully disagree that the path to the assembly is a good 
> choice. I understand that the Linux binary isn't the same as the .Net 
> assembly, but the EXE file is not there at all.

 From the point of view of .NET Assembly APIs the EXE file *is* there.

You can access it by System.Reflection, you can load it (once more ;)
as it's already loaded). You can load resources from it, you can check 
its meta data, assembly name, public key, etc.

Indeed, System.IO APIs won't see this file, but you don't
really expect that mkbundle's infrastructure is going to redirect
file access into the bundle, do you?

The only bug I can sense is how the mono runtime is reporting
the Assembly.Location of bundled assemblies. I'd rather
expect an empty string for Location as this is usually an
indicator that the assembly was loaded from a byte blob
rather than from a file.


More information about the Mono-devel-list mailing list