I was able to solve my problem by defining
target="@executable_path/libfoo.dylib". this has worked great.

I have a new issue now. I need to embed a dll into my redistributable
application. Some code is trying to load this dll using
Assembly.LoadWithPartialName() at runtime. It seems that embedding
this dll using the with-assembly sub-tag of my mkbundle task is not
sufficient for it to be found by LoadWithPartialName().

I _can_ however distribute this dll outside of the app bundle, and run
the app from the command line with the MONO_PATH environment pointed
to the dll's path.

My question is: how can I include or embed this dll in the app bundle
in a way that it can be loaded at runtime?

--Anthony

On Tue, Feb 16, 2010 at 1:40 PM, Duane Wandless <du...@wandless.net> wrote:
> I embed my app so your solution will most likely be different.  I call:
>
> mono_config_parse ([configFile UTF8String]);
>
> Where configFile contains the full path to my target libfoo.dylib.
> You can also do this:
> MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" mono MyProgram.exe
> Which will give lots of debug output and help identify why it cannot find
> the dll.
> Hope this points you in the right direction.
> Duane
> On Tue, Feb 16, 2010 at 3:49 PM, anthony taranto <anthony.tara...@gmail.com>
> wrote:
>>
>> Hello,
>>
>> I'm building an application using monobjc. This application has a dll
>> that relies on a compiled c library (dylib). When running my
>> application using the mono installation, I have a dll.config file with
>> the following contents:
>>
>> <configuration>
>>  <dllmap dll="foo" target="libfoo.dylib" />
>> </configuration>
>>
>> This config file is placed in the same directory as my .exe and .dll
>> files and i can run the application.
>>
>> When building a standalone application, I can't run it because it
>> can't find libfoo.dylib. This seems to have something to do with
>> relative paths. I notice that the mkappl nant task outputs that it is
>> including and "relocating" the config file.
>>
>> My question is, what path can I supply to the target attribute to get
>> my standalone application to load libfoo.dylib appropriately?
>> Alternatively, how should I approach this problem?
>>
>> Thanks,
>>
>> --Anthony
>
>

Reply via email to