Hello,
The search path by default is the place where the application is launched
(it is '/' when launched from the Finder). If you launch the application in
the folder where the executable lies, the native library lookup will go
fine.
If you paste this code into your Main method (after
NSApplication.Bootstrap), the lookup path will be the folder where the
executable lies and native libraries will be loaded as planned.
String dir =
Path.GetDirectoryName(NSBundle.MainBundle.ExecutablePath);
Console.WriteLine("D=" + dir);
Directory.SetCurrentDirectory(dir);
I have summarize the steps to embed assemblies that contains DLLImport
attributes (like Mono.Posix):
- embed the assembly in the native executable (Done)
- relocate 'dllmap' element in the assembly config (I am working on it)
- embed the modified assembly config in the native executable (Done)
- copy and relocate the native library declared in the DLLImport attribute
(Done)
I will try to generate an interim build of the NAnt task that do almost
everything for you to test.
Regards
2008/8/14 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>
> That may or may not be related to the problem of finding shared
> libraries...
> I've put that line inside awakefromnib
>
> Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
>
> I get "/" as the base directory, even if my application is not inside the
> volume directory. I get this problem with "nant native".
>
> If I just use "nant" I get:
> Aug 14 13:48:36 Indian [0x0-0x21021].net.monobjc.samples.Shufl[343]:
> /ShuflMac/dist/Shufl.app/Contents/Resources
>
>
>
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>
>
>