Forum Xamarin.iOS

Using dllmaps in a Xamarin.Mac Application

SumalathaSumalatha USMember

Hello,
I am using a dllmap in my Xamarin mac application to point the system library framework to our unmanaged libraries as mentioned in this discussion ( http://stackoverflow.com/questions/14536843/including-custom-dll-and-dylib-in-monomac-app ). Following is the configuration file

    <configuration>
            <dllmap dll="Kerberos" target="/opt/{XYZ}/libkrb5.dylib"/>
    </configuration/>

I named this file as {App}.exe.config and places it next to the {App}.exe file.

However my changes doesn't seem to have any effect. How do I test if the dllmap file is loaded properly?

Thanks,
suma

Best Answer

Answers

  • DanSmith.1531DanSmith.1531 USMember ✭✭

    Is your application Sandboxed? If so, the runtime may not be able to open that library in /opt. (You'd see some error messages in the console.app) Regardless, I've never used dllmap outside of the application bundle.

    In my project, I've imported the .dylib into my project, and set the Quick Properties on it to "Copy to Output Directory", and reference it with the following code in the App.exe.config. (Oh...is the "App.exe.config" file set to Copy to Output Directory as well? (You can inspect the created bundle by right clicking on the application output and select "Show Package Contents". From there, the exe.config file should be in ".app/Contents/Resources/.exe.config"

    <configuration>
        <dllmap dll="Helper" target="libHelper.dylib" />
    </configuration>
    
  • SumalathaSumalatha USMember

    @DanSmith.1437 , I have not tried using the dllmap within the application bundle. I will copy my dylib and try that.

    I have a question regarding the config file location. My App.exe.config is under .app/Contents/MonoBundle/ next to the Application exe file. Should I be moving it to the .app/Contents/Resources folder instead?

  • SumalathaSumalatha USMember

    Does anyone know how to set dllmap which points to a library outside of application bundle?

Sign In or Register to comment.