[Mono-devel-list] Proposal: Library Loading
jonpryor at vt.edu
Wed Apr 14 23:21:27 EDT 2004
On Wed, 2004-04-14 at 19:36, Jonathan Gilbert wrote:
> It seems to me there is an even better solution: put the mapping file into
> the same directory as the assembly that needs it. Then, there is no chance
> of filename conflicts. There is already App.exe.config; perhaps a custom
> section could be added that Microsoft's code would ignore but which Mono's
> code would use to determine the correct version to load? If this isn't
> practical, then a separate file could be used -- App.exe.libmap? Obviously,
> Microsoft's code would completely ignore this file.
This isn't entirely correct/possible. App.exe.config files only apply
to .exe assemblies, not .dll assemblies. Which means that gtk-sharp.dll
can't have a .config file associated with it. At least, not under .NET.
I think it would be very impractical to require each application to
specify which library versions its dependent assemblies require, as the
application authors don't want to know; they just want the assembly to
As an extension, Mono could interpret an AssemblyName.extension.libmap
file (applying to both .exe and .dll files). On the bright side, this
eliminates the issues of maintaining a centralized config file, and
potentially simplifies package management. It also keeps the version
information external to the assembly, as Ferdinand Pranti requested.
The downside is it's still a multi-file approach, with the performance
implications that implies (extra startup time, etc.).
Just to bring up a completely different attach vector... What should we
do in the interests of standardization? :-D
We have Mono, Portable.NET, and Rotor on Unix-like platforms. Each of
these (hopefully) needs/intends to solve this problem, so a solution
that distributors/packagers could use that would apply to all of them
would be useful, to help minimize duplication.
I can't see a centralized configuration file as being acceptable to all
of them, but maybe it would be (/etc/ecma-cli/assemblies/map.xml?).
I now think a one config file (.libmap file) per assembly approach is
more sensible, with the added benefit that it solves Michal Moskal's
issue -- different assemblies could load different library versions and
things could "just work". I don't think the current
$prefix/etc/mono/config file can solve this particular problem. The
downside is decreased performance (the affect of which would need to be
measured), an increased number of files, and potential tool
complications (gacutil would need to copy the assembly's .libmap file,
if present, in addition to the assembly itself).
More information about the Mono-devel-list