[Mono-devel-list] MONO_PATH versus GAC problem in DLLImport resolution was keeping me from running GTK# apps in mono

Rafael Teixeira monoman at gmail.com
Thu Nov 4 14:13:15 EST 2004

Well, it seemed like the runtime was not respecting dll config files
so that this gtk-sharp.dll.config file was being ignored

  <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/>
  <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/>
  <dllmap dll="libatk-1.0-0.dll" target="libatk-1.0.so.0"/>
  <dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0"/>

it is located in the gac beside the dll proper as installed by gtk#.

[rafael at redhat9 samples]$ export MONO_LOG_LEVEL=debug
[rafael at redhat9 samples]$ export MONO_LOG_MASK=dll,cfg

[rafael at redhat9 samples]$ mono alomundo-gtk-boo.exe
Mono-INFO: Config attempting to parse:

that was the key to find the culprit:

My MONO_PATH contained the /usr/lib/mono/gtk-sharp, and so it was
finding the symbolic link to the assembly that gacutil leaves there
and was trying to read the config file from there. Just shortened my
MONO_PATH and all went well.

Nevertheless this interaction between MONO_PATH and GAC is somewhat to
be aware of.

I was using MONO_PATH to easy command lines like

mcs -r:gtk-sharp alomundo-cs.cs

Yeah I know about the -pkg: option for mcs, and I implemented it for
mbas, but boo compiler (booc) still doesn't have one, so the backtick
trick will be needed to escape this trap for some more type.

booc `pkg-config --libs gtk-sharp` alomundo-gtk-boo.boo

Hope this information helps someone else, too
Rafael "Monoman" Teixeira
Just the 'crazy' me in a sane world, or would it be the reverse? I dunno...

More information about the Mono-devel-list mailing list