I have tried twice to install and run KeePass under mono in OS X, and it won't work.
After installing mono, Quartz, and KP from the zipped file, I opened Terminal. I switched to the Applications/KeePass directory (which I had created for the KP files), and then ran "mono KeePass.exe" without the quotes. Here is the Terminal output. What's wrong? All help much appreciated.
System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: libgdiplus.dylib
at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Drawing.KnownColors..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Drawing.Color.get_Black () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Windows.Forms.ThemeVisualStyles..ctor () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.ThemeEngine..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown="">:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.Form..ctor () [0x00000] in <filename unknown="">:0
at KeePass.Forms.MainForm..ctor () [0x00000] in <filename unknown="">:0
at (wrapper remoting-invoke-with-check) KeePass.Forms.MainForm:.ctor ()
at KeePass.Program.Main (System.String[] args) [0x00000] in <filename unknown="">:0
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: libgdiplus.dylib
at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Drawing.KnownColors..cctor () [0x00000] in <filename unknown="">:0
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Paul: Tried it on another machine. Didn't work. There's no ~.config.xml file, just a ~.config file, which doesn't have the line referred to in that post.
David: Thank you. I've tried this on two machines, and, on one, installed mono from two different builds and sources (the project itself, and the KP2-on-mac page listed on the KP downloads page). Since mono doesn't seem to be installing the file, I will look for it on the web and see if I can get the paths correct. I'm not fluent on OS X, so it may be a couple of days until I can run through some attempts. Any suggestions welcome.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can find the file by running locate libgdiplus.dylib.
You shouldn't have to do this, but you can launch using LS_DYLIB_PATH=<path that you found from the previous command> mono KeePass.exe to force it to look for the library in this path.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have exactly the same problem. I installed mono 3.8.0 and XQuartz 2.7.6 on OSX (10.9.5). Then unzipped KeyPass-2.27.zip.
I found the libgdiplus.dylib file on my system at /Library/Frameworks/Mono.framework/Versions/3.8.0/lib/libgdiplus.dylib, so I ran the following command:
Yes, the library path should just be the folder name and not include the file name. i.e LD_LIBRARY_PATH=/Library/Frameworks/Mono.framework/Versions/3.8.0/lib
Could be that something broke in mono 3.8.x.
You can actually have more than one Mono version installed at a time. I believe just checked and my default mono version is 2.10.x, which works without having to specify the library path. Up till now, I thought I was using a newer version of Mono.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried twice to install and run KeePass under mono in OS X, and it won't work.
After installing mono, Quartz, and KP from the zipped file, I opened Terminal. I switched to the Applications/KeePass directory (which I had created for the KP files), and then ran "mono KeePass.exe" without the quotes. Here is the Terminal output. What's wrong? All help much appreciated.
System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: libgdiplus.dylib
at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Drawing.KnownColors..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Drawing.Color.get_Black () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Windows.Forms.ThemeVisualStyles..ctor () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.ThemeEngine..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown="">:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename unknown="">:0
at System.Windows.Forms.Form..ctor () [0x00000] in <filename unknown="">:0
at KeePass.Forms.MainForm..ctor () [0x00000] in <filename unknown="">:0
at (wrapper remoting-invoke-with-check) KeePass.Forms.MainForm:.ctor ()
at KeePass.Program.Main (System.String[] args) [0x00000] in <filename unknown="">:0
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: libgdiplus.dylib
at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown="">:0
--- End of inner exception stack trace ---
at System.Drawing.KnownColors..cctor () [0x00000] in <filename unknown="">:0
Have you tried modifying KeePass.config.xml per this thread?
https://sourceforge.net/p/keepass/discussion/329221/thread/6a0d9af8
cheers, Paul
Thanks, Paul. No, I looked for solutions but missed that one. I will try it when I get back to that machine in a day or two. I'll update this thread.
The root of the problem is:
It can't find libgdiplus.dylib, so either mono is not installed properly or you have an issue with library search paths.
Paul: Tried it on another machine. Didn't work. There's no ~.config.xml file, just a ~.config file, which doesn't have the line referred to in that post.
David: Thank you. I've tried this on two machines, and, on one, installed mono from two different builds and sources (the project itself, and the KP2-on-mac page listed on the KP downloads page). Since mono doesn't seem to be installing the file, I will look for it on the web and see if I can get the paths correct. I'm not fluent on OS X, so it may be a couple of days until I can run through some attempts. Any suggestions welcome.
You can find the file by running
locate libgdiplus.dylib
.You shouldn't have to do this, but you can launch using
LS_DYLIB_PATH=<path that you found from the previous command> mono KeePass.exe
to force it to look for the library in this path.I have exactly the same problem. I installed mono 3.8.0 and XQuartz 2.7.6 on OSX (10.9.5). Then unzipped KeyPass-2.27.zip.
I found the libgdiplus.dylib file on my system at /Library/Frameworks/Mono.framework/Versions/3.8.0/lib/libgdiplus.dylib, so I ran the following command:
LS_DYLIB_PATH=/Library/Frameworks/Mono.framework/Versions/3.8.0/lib/libgdiplus.dylib mono KeePass.exe
But the exception I get is still the same...
Try LD_LIBRARY_PATH=/Library/Frameworks/Mono.framework/Versions/3.8.0/lib mono KeePass.exe
Note it only worked for me after downgrading mono to 3.6.0
Yes, the library path should just be the folder name and not include the file name. i.e
LD_LIBRARY_PATH=/Library/Frameworks/Mono.framework/Versions/3.8.0/lib
Could be that something broke in mono 3.8.x.
You can actually have more than one Mono version installed at a time. I believe just checked and my default mono version is 2.10.x, which works without having to specify the library path. Up till now, I thought I was using a newer version of Mono.