Search code examples
c#motorola-emdk

MC95 - Loading camera throws Can't find PInvoke DLL 'EMDKServices.dll' error


I'm developing a .net application on a Motorola MC95 scanner and when trying to turn on the camera I am getting this error: Can't find PInvoke DLL 'EMDKServices.dll'. I have received this error before but it was always if the scanner was already enabled. I'm running the same code on 4 scanners and can only reproduce the issue on two of them. Unfortunately the two scanners that we can reproduce the issue with are a few thousand miles from me.

What would be possible causes for receiving the error: Can't find PInvoke DLL 'EMDKServices.dll'. When enabling the camera?

I've had them try the default demo app and it loads and takes a picture without issue.

Using EMDK for .Net version 2.8


Solution

  • The actual cause for this was that the scanner that was throwing the error was missing the 'Symbol Managed Class Libraries' application. It was determined that when deploying directly from visual studio to the scanner it automatically pushes and installs this application, but when deploying via a cab installer it does not get installed. The fix was to add a check to the application startup to see if the libraries were installed and throw an error to the user.

    if (System.IO.Directory.Exists(@"\Windows\AppMgr\Symbol Managed Class Libraries\") == false)
    {
        DisplayMessage("Symbol Managed Class Libraries not detected. Please Install or contact help desk.", "Error");
    }
    

    To install the libraries run the following cab on the device: Get the cab from a computer that has the EMDK installed: C:\Program Files (x86)\Motorola EMDK for .NET\v2.8\SDK\Smart Devices\wce500\armv4i\symbol.all.arm.cab Once this is run and installed on the device the camera works perfectly.

    I investigated for a way to include this cab in my cab but didn't find a clean way to do it without doing a lot of after work after every build. Considering it's a one time run per device I am fine with the error message.