I am having a lot of trouble getting a basic scenario to work on windows mobile 5.0 emulator. I have a winforms app that eventually calls into native code. Deployment works fine and all the native DLLs are copied in the same folder as the winforms .exe. I also verified this is the case with Remote File Viewer tool.
However when I launch my app, it always fails with "Can't find PInvoke dll -- System.MissingMethodException" error (when the time comes to call into native code, the DllImport attribute is rendered useless). I know that the native dll is found in the same folder as the executable. What more should I do?
I am using VS 2008.
To extend Jared's answer, four more common reasons to get a MissingMethodException while P/Invoking in the CF:
Have you verified the DLL entry points are undecorated with something like dumpbin?
Given the error message there are usually one of 2 problems
__declspec(dllexport)
Also, sanity check is to make sure the DLL name is spelled correctly and lacking the .dll suffix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With