I've been battling this for a few hours now, and it may just be that I don't understand reference assemblies as well as I should.
I have a .NET CF 1.0 application running on Windows CE 4.2/5.0.
There is a managed assembly that is part of the SDK for the device that I added as a reference to my project.
Most of the time, everything works great. I can call the methods and successfully modify the state of the device (e.g. set the keyboard state or dim the backlight).
On some devices, when my application hits the code that references the DLL, it just blows up on itself
My problem is that I can't recover from this. The code is fully contained in a try/catch catching a generic Exception:
try
{
if (Terminal.API.UnitAPI.KbdGetKeyInputState() ==
(int)Terminal.API.KbdState.AlphaOn)
Terminal.API.UnitAPI.KbdSetKeyInputState
(Terminal.API.KbdState.AlphaDown);
}
catch (Exception e)
{
log("Error loading DLL: " + e.Message);
}
If anyone has any ideas on how to recover correctly from this, I would appreciate it. Thanks.