1

I am trying to use the EDSDK on macOS 10.9.1 through the medium of C#.

I am using Xamarin and I get no DllNotFoundException's, so presumably it is finding the framework. Neither am I getting an EntryPointNotFoundException so that's not the issue.

When I try and call EdsInitializeSDK() it simply never returns, as if it were in an infinite loop or something similar.

If I call other functions which obviously return an error code since the SDK is not initialised they return without the IDE flagging up any problems.

Does anyone have any idea why this might be happening?

Additionally the sample (Objective C) program runs successfully.

DumbBrunette
  • 83
  • 1
  • 6

1 Answers1

1

to get the SDK running with C# on mac you should:

  • Copy EDSDK.framework and DPP.framework into your built *.app in the folder "Contents/Frameworks/" (you might need to create this folder)
  • Add a App.config file to your project with the following content:

    <?xml versin="1.0"?>
    <configuration>
        <dllmap dll="EDSDK" target="@executable_path/../Frameworks/EDSDK.framework /EDSDK" />
    </configuration>
    
  • In the wrapper class where you do the P/Invoke you need to change

    [DllImport("EDSDK.dll")]
    

    to

    [DllImport("EDSDK")]
    

    (using dllmap with dll="EDSDK.dll" sadly doesn't work, you'll have to stick to "EDSDK" or any other name without .dll)

If you follow these steps your program will work perfectly fine.

Kind regards

Johannes Bildstein
  • 1,069
  • 2
  • 8
  • 20
  • Thank you for your efforts on Canon SDK tuts and sharing it with others, i downloaded your code from codeproject and got a copy of the cannon dll files as well i connected my camera(Rebel T3) to my PC, when i run your program it does not give any error but it doesnt get the camera name in the list, i should mention that i have not installed any extra drivers since when i connected the camera they got installed automatically please help me i have a tight deadline, thanks once again. please do help – Abdullah Malikyar May 31 '15 at 13:28