Find your next scenic drive!

June 10, 2006

.NET and loading assemblies for other platforms...

If you are working with .NET, and you see the following exception:

TypeLoadException: Method 'Dispose' in type 'eSQL.SqlConnection' from assembly 'eSQLNet, Version=2.9.2056.14469, Culture=neutral, PublicKeyToken=null' does not have an implementation

Make sure that the .NET assembly you are referencing (eSQL in this case) is for your current platform.

In the case depicted above, I had accidentally selected the ARM version of the eSQL DLL instead of the x86 version. Unfortunately, however, the exception message above does not exactly say that. It would have been nicer to have gotten a message that would have said something about the assembly not being compiled for the current platform...

March 22, 2006

OpenNETCF.org Desktop.Communication Library 2.9...

About a month ago, a new version of OpenNETCF.org Desktop.Communication Library was released, and I finally got a chance to work with it last night. Unfortunately, the problem I discussed here regarding the FileInformation buffer is too small is still an issue in this release. I think that it was accidently removed, since the file has a number of whitespace-type changes from the previous release.

Another issue that has not been fixed is the issue I reported to the forums. The issue is that if the RAPI fails to communicate with ActiveSync, an exception is thrown, but the finalizer is still called, and the finalizer does not properly handle the case where the constructor is not ran to completion. This is handled by a quick fix of (changes are in bold):

  1. // ...
  2. ~RAPI()
  3. {
  4.   if ( m_activesync != null ) {
  5.     m_activesync.EndListen();
  6.   }
  7. // ...

And aside from hitting the first problem in my application, the new release seems good after patching the above two issues.

January 6, 2006

RAPI EnumFiles error...

Recently, I was working with the Open .NET Compact Framework’s Desktop.Communication Library, writing a simple program to go through the device and show me all the files and directories below a certain starting point using the API’s RAPI.EnumFiles method.

Prior to adding the recursion, this program was working great. But once I added the recursion, the program began throwing a FatalExecutionEngineError exception usually at the EnumFiles method (but not always) and what was also interesting is the fact that it would sometimes recurse 10 directories and other times hundreds. The exact wording of the exception is as follows:

FatalExecutionEngineError was detected: The runtime has encountered a fatal error. The address of the error was at 0x7a0c6df2, on thread 0x1678. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Googling over this error did not bring up very many useful results. However, I finally fell onto the post, FileInformation buffer size is too small. I downloaded the code, downloaded the RAPI.cs version 1.2 (Username: guest, Password: guest), built the library, and viola! It appears to have solved my problem.

Earlier Entries