[Mono-devel-list] Proposal: Library Loading

Mike Kestner mkestner at ximian.com
Thu Apr 15 10:45:33 EDT 2004


On Thu, 2004-04-15 at 08:45, Paolo Molaro wrote:
> BTW, today I finally wrote the few changes needed to support
> per-assembly config files as was planned from the beginning: 

Sweet.  Thanks a bunch for this work.  :-)

> We don't use custom attributes also because they don't allow the user to
> edit them:-)
> The current code in cvs will try to load:
> 	assemblyfilename.config
> 	sysdir/assemblyname.config // with variations to support different versions
> 	userdir/assemblyname.config

So I talked to lupus about this on irc, and just to expand on this, the
idea is that in your cvs modules and tarballs, you set up the config
files to install into libdir.  That way users can build your package and
install to whatever prefix they want with whatever privs they want. 
Then when packagers come along and dist your work, they can relocate the
config files to sysdir to keep their distributed libdirs all squeaky
clean.

> On 04/14/04 Jonathan Pryor wrote:
> > 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.
> 
> Since the MS .net doesn't care about dllmap, that is not an issue.

Right.  One problem we seem to have is people actually install
etc/mono/config on win32, which hoses up Gtk# since we don't want the
names mapped on win32.  ;-)

> With P/Invoke the assembly writer knows which version of the shared
> library he programmed against, so he needs to specify the version/soname
> (hi mike!).

Haha.  I love you too, Paolo.

> If people read the past discussions they'd have read that the
> per-assembly config file was considered from the beginning: it wasn't
> implemented only because I had other things to do, it was not yet really
> needed and people like to argue about it more than writing the code.
> It's in cvs now.

As for my own whining on the topic, it's just I was certain that your
solution would be more beautiful than anything I could produce myself. 
;-)

Thanks again for adding this.

/me goes and writes some *.dll.config files.

-- 
Mike Kestner <mkestner at ximian.com>




More information about the Mono-devel-list mailing list