Part of the solution seems to be to use adjust the c source code for the native binary to call either mono_config_parse or mono_config_parse_memory. Now to sort out my paths and get this working neatly.
Sent: Wednesday, October 15, 2008 12:11 PM To: users@lists.monobjc.net Subject: [EMAIL PROTECTED] An mkbundle with gdiplus.dll Hi everyone, I am having a terrible time building a native binary with mkbundle of my Application. My App uses Monoobjc.Cocoa and System.Drawing. The latter requires gdiplus.dll. I am using the MonoFramework-2.0_4 and when Mono is installed on the machine, the machine.config file contains these two dllmap lines to help apps locate gdiplus.dll: <dllmap dll="gdiplus.dll" target="/Library/Frameworks/Mono.framework/Versions/2.0/lib/libgdiplus.dylib " /> <dllmap dll="gdiplus" target="/Library/Frameworks/Mono.framework/Versions/2.0/lib/libgdiplus.dylib " /> I am using the excellent NAnt.Monobjc.dll mkbundle task to create my native binary, with the following fragments: <mkbundle exe="${build.dir}/MyApp.exe" todir="${macbuild.dir}" target="MACOSX_10_4" universal="true" rebuild="true"> <search-in basedir="${build.dir}"/> </mkbundle> <mkappl name="MyApp" todir="${mac.dir}" native="true" icon="${build.dir}/Mac/MyApp.icns" infoplist="${build.dir}/Mac/Info.plist"> <!-- Copy executable --> <copy-in-macos basedir="${macbuild.dir}"> <include name="MyApp"/> <include name="lib*.dylib"/> </copy-in-macos> <!-- Copy other files or folder --> <copy-in-resources basedir="${build.dir}/Mac"> <include name="MyShell.nib/*"/> </copy-in-resources> </mkappl> When I add the following element, it correctly copies the libgdiplus.dylib and depenedent files to the MacOS folder of my bundle <with-lib file="/Library/Frameworks/Mono.Framework/Versions/2.0/lib/libgdiplus.dylib" /> But when I run the app without Mono installed on the machine, I still get the System.DllNotFoundException: gdiplus.dll So it is obviously missing the dllmap entries and the embedded mono runtime is not able to resolve gdiplus.dll to libgdiplus.dylib (or in fact libgdiplus.0.0.0.dylib in this case) to load it from my MacOS directory. I have tried creating both an App.config and Machine.config file and embedding using the mkbundle task, but Mono still seems unable to either load the config files, or use the dllmap entries: <configuration> <dllmap dll="gdiplus.dll" target="libgdiplus.0.0.0.dylib"/> <dllmap dll="gdiplus" target="libgdiplus.0.0.0.dylib"/> </configuration> Any help would be very much appreciated! Laurent, I noticed your reply to this list on August 11th (subject: .config file) in which you mention a possible Mono runtime bug when config files are embedded with mkbundle. Is there any update with this? Also, is there any way to programatically set dllmap information, since in my code before I use System.Drawing? I would love to say something like MonoRuntime.DllMaps.Add("gdiplus.dll", "libgdiplus.0.0.0.dylib"); Many thanks, Anthony