0

Is it possible to control a Canon Camera on the latest .NET, currently .NET 6, or Core or Standard using their EDSDK.dll version 13.15.10.3 or any other lib via C#?

Control = snap a pic, save the image, set some settings, etc.

Canon provides a SDK EDSDK.dll and example C# code circa .NET 4.5 (2012). Current dll version is 13.15.10.3.

In framework the example app works and uses [DllImport("EDSDK.dll")]

The same code and lib on .NET 6 throws this error:

System.BadImageFormatException HResult=0x8007000B Message=An attempt was made to load a program with an incorrect format. (0x8007000B) Source=HardwareControl
StackTrace:
at EDSDKLib.EDSDK.EdsInitializeSDK()

Any info to how this would be done with the latest tools OR a strong 'noop, move on' is appreciated.Thanks!

/rant: MS basically pulled a 'New Coke' over .NET versions so here is a random primer.

4
  • 1
    Have you tried explicitly using x86 or explicitly using x64 for the runtime? I suspect that's the problem (and my guess is that you want x86). Commented Jul 21, 2022 at 17:46
  • @JonSkeet it worked on x86! You have too much knowledge for one mind :) Thank you! Commented Jul 21, 2022 at 20:12
  • @TheDev6 hi, can you send me a link please to a working project of yours for the camera control ? i have eos 550d and i can't make it work and i'm trying for hours with the dll's and getting exception. please help me. Commented Jul 22, 2022 at 21:08
  • @EliotShein Unfortunately Canon makes you sign up for the sdk and samples. But EDSDKLib.EDSDK.EdsInitializeSDK(); is the line that will blow up if your dll is not found, or x86/x64 is not set on the class lib to the corresponding target of the dlls. Commented Jul 25, 2022 at 18:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.