Reputation: 191
I find myself unable to run any WinForms applications in Mono 3.0 (on OpenSUSE 12.3 x64). The problem I get is System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /usr/local/lib/libgdiplus.so
. The reason it's not find libgdiplus.so is that it's not in /usr/local/lib
on my system but rather /usr/lib64
. I know for a fact that /usr/lib64
is in ldconfig's path, and I've also tried changing the dllmap entries for gdiplus in /etc/mono/config
to point directly at it, and the error persists.
I have a complete log of trying to run MoMA with MONO_LOG_LEVEL="debug"
here. It seems to be ignoring the config file and looking directly for the SO in the wrong place.
Is there any way to make it look for this SO in the right place?
Upvotes: 1
Views: 2514
Reputation: 76
@PrinceBilliard - the root cause is a change to /data/config.in that added the (partially) hard-coded path to libgdiplus.so. The real fix would be to modify the source code to remove the path from the entry, leaving just libgdiplus.so in the entry.
If you have a path in the config file, Mono will use that path and ignore the ldconfig cache and LD_LIBRARY_PATH. Without a path, Mono will try the library name with different suffixes as well as referring to the ldconfig cache and LD_LIBRARY_PATH.
The way I dealt with it in my package spec was to add a %post task to edit /mono/config and strip out the path from the entry. RobFlum
Upvotes: 3