If have an application (let's call it A, CF 3.5) which calls another application (B, CF 3.5 as well) within the same directory to delegate some work (downloading a file). This works well, as long as the SQL Server CE assemblies (3.5 SP2) are not loaded by application A. If they are, application B will crash with random file system errors (e.g. assemblies which cannot be loaded) and and a lot of exceptions in filesys.exe. Here's the content of the error report generated by Windows Mobile:
Bucket Parameters
EvntType: WinCE50lbException
AppName: filesys.exe
AppVer: 5.2.0.0
AppStamp: 29ccdda8
ModName: vcefsd.dll
ModVer: 5.2.0.0
ModStamp: 52652c34
Offset: 000017a0
OwnName: B.exe
OwnVer: 1.0.0.0
OwnStamp: 5003c932
This error will occur several times even after debugging has ended and both applications do no longer run. An example of the error which occurs in application B itself:
File or assembly name 'OpenNETCF.Drawing, Version=2.2.0.0, Culture=neutral, PublicKeyToken=...' or one of its dependencies, was not found.
The assembly name changes from time to time (it can be the CF 3.5 assemblies as well). The error occurs in the emulator (always), but never on a real device. If application A is downloading the file instead of delegating the work to B, no error will occur.
I suspect the storage card driver of the emulator to cause this error, but I have no idea how I can debug the issue any further.
Note: Application A loads the locally deployed SQL CE libraries (sqlceoledb35.dll, sqlcese35.dll, sqlceqp35.dll, sqlceme35.dll, sqlceca35.dll, sqlcecompact35.dll) using the following API call:
[DllImport("coredll.dll")]
private static extern IntPtr LoadLibrary(string fileName);
Update
After I removed the OpenNETCF references for a test I got this exception:
Unable to read configuration file '...\some.config': UnauthorizedAccessException
Which is an exception wrapped by our configuration manager (I can't debug it because it occurs in B). Application A reads that file but closes and releases it right away after deserialization.