System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
Ticket Hash: 2c15da7eae7c23807db47aa4ff85fb77c3dffcd2
Title: Compact Framework: Can't find PInvoke dll 'SQLite.Interop.DLL'
Status: Closed Type: Incident
Severity: Important Priority: High
Subsystem: Integration_Via_PInvoke Resolution: Unable_To_Reproduce
Last Modified: 2012-01-18 10:28:14
Version Found In: 1.0.77
Description:
On one device we get the 'unable to load Interop...' - error when trying to open a SQLiteConnection:

StackTrace:
System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool)
System.Data.SQLite.SQLiteConnection.Open()
...

This doesn't happen everytime, sometimes it works without any changes (after closing and restarting the application)!
The Interop and the System.Data.SQLite.DLL are located in the same directory.

The device is a "Trimble TSC2" (Windows Mobile 5.0) with CF 3.5 installed.

<hr /><i>mistachkin added on 2012-01-17 00:43:09 UTC:</i><br />
Is it possible for you to supply the full stack trace and/or the exception that is being thrown?  Also, do you have some sample code which demonstrates the issue?

<hr /><i>anonymous added on 2012-01-18 08:14:32 UTC:</i><br />
Ok, it looks like this is a memory related problem! We're just doing the following:

Dim conn As New SQLite.SQLiteConnection(cs)

conn.Open()

=> System.MissingMethodException:

Can't find PInvoke DLL 'SQLite.Interop.DLL'

at System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool)

at System.Data.SQLite.SQLiteConnection.Open()

...(button pressed etc.)

Before initializing the SQLiteConnection, we're initializing some forms. If we do this, it sometimes works, sometimes not. If we skip initializing the forms, it always works!
Now I don't know if you can do sth. about this... is there maybe a possibility to compile a "combined"-dll (Interop & SQLite-DLL) for the Compact Framework?

<hr /><i>mistachkin added on 2012-01-18 10:25:25 UTC:</i><br />
As far as I know, the Compact Framework does NOT support mixed-mode assemblies.  For example, see <a href="http://stackoverflow.com/questions/6777209/mixed-mode-on-windows-ce-compact-framework">this question on StackOverflow</a>.