System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
Ticket Hash: 489bfa53fcc10d0fe5bc2472e6f77c1c298ea5c3
Title: Unable to load DLL 'SQLite.Interop.DLL' (test.exe)
Status: Closed Type: Incident
Severity: Critical Priority: Immediate
Subsystem: None Resolution: Not_A_Bug
Last Modified: 2011-10-27 13:14:13
Version Found In: 1.0.76
Description:
Hello,

I am using 1.0.76 version on VS2010.  All runs fine, my app compiles and I need to distribute it to the customer.

I am distributing to a test workstation with Windows XP SP2 and almost any software installed.  A clean environment.

Aplication structure:
 C:\app\myApp.exe
 C:\app\System.Data.SQLite.dll
 C:\app\System.Interop.dll


We have problems at the start with:
Unable to load DLL 'SQLite.Interop.DLL'.

I have tried to COPY+PASTE all SQLite-installation-folder to the testing workstation.  Warning:  COPY+PASTE... not install SQLite.   And I have tried to execute test.exe but the problem is the same:

<code>
************** Texto de la excepción **************<br />
System.Reflection.TargetInvocationException: Se produjo una excepción en el destino de la invocación. ---> System.TypeInitializationException: Se produjo una excepción en el inicializador de tipo de 'System.Data.SQLite.SQLiteFactory'. ---> System.DllNotFoundException: No se puede cargar el archivo DLL 'SQLite.Interop.dll': No se puede encontrar el módulo especificado. (Excepción de HRESULT: 0x8007007E)<br />
   en System.Data.SQLite.UnsafeNativeMethods.sqlite3_config(Int32 op, SQLiteLogCallback func, IntPtr pvUser)
   en System.Data.SQLite.SQLite3.SetLogCallback(SQLiteLogCallback func) en c:\dev\sqlite\dotnet\System.Data.SQLite\SQLite3.cs:línea 957<br />
   en System.Data.SQLite.SQLiteLog.Initialize() en c:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteLog.cs:línea 163<br />
   en System.Data.SQLite.SQLiteFactory..cctor() en c:\dev\sqlite\dotnet\System.Data.SQLite\LINQ\SQLiteFactory_Linq.cs:línea 25<br />
   --- Fin del seguimiento de la pila de la excepción interna ---<br />*******************************************<br />
</code>
What can I do to distribute our application and execute it without any problems.

Thanks.

<hr /><i>anonymous added on 2011-10-26 16:44:59 UTC:</i><br />
After copy this file:
<code>
MSVCR100.dll
</code>

To the same application folder.

I have the error:<br />
<code>System.BadImageFormatException: Se ha intentado cargar un programa con un formato incorrecto. (Excepción de HRESULT: 0x8007000B)<br />
   en System.Data.SQLite.UnsafeNativeMethods.sqlite3_open_interop(Byte[] utf8Filename, Int32 flags, IntPtr& db)<br />
   en System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool)<br />
   en System.Data.SQLite.SQLiteConnection.Open()<br />
</code>

I am stuck here..... :-(

<hr /><i>mistachkin added on 2011-10-26 17:43:21 UTC:</i><br />

Please make sure that you are using the SQLite.Interop.dll and MSVC runtime files for the processor architecture that matches your machine.


<hr /><i>anonymous added on 2011-10-26 18:22:01 UTC:</i><br />
Compiling in x64.

Test workstation (VirtualBox x86).

I am going to test it inmediately and come back with results.

<hr /><i>anonymous added on 2011-10-26 18:55:50 UTC:</i><br />
You are right...<br />
<br />
I was using <code>msvcr100.dll</code> from the <code>C:\WINDOWS\SYSTEM32</code> (on x64 development computer).   I have checked it with depents.exe and it was a x64 library. :-(<br />

At last I have found, renamed and used <code>'msvcr100_clr0400.dll'</code> on the runtime workstation and I could run <code>test.exe</code> only with an error.<br />
I have that error in tests (multithreaded test) but It was only a test.  Now I am going to download & install this: 
<a href=http://www.microsoft.com/download/en/confirmation.aspx?id=5555>vcredist_x86.exe</a> and try it again.<br />
<br />
Perhaps it is a virtual box stuff.  I don't know.<br />
<br />
<br />
A question: Can I avoid the installation of this library _msvcr100.dll_ on some way ? <br /><br />Can I get in someway ONLY a library SDS with Interop and msvcr100.dll already included ?  This will be great.<br /><br />

Thank you very much..... and congratulations for your work.

<hr /><i>mistachkin added on 2011-10-27 13:13:03 UTC:</i><br />
You can download one of the following statically linked release packages:

<a href="https://system.data.sqlite.org/sqlite-netFx40-static-binary-bundle-x64-2010-1.0.76.0.zip">Precompiled Statically-Linked Binaries for 64-bit Windows (.NET Framework 4.0), mixed-mode assembly</a>

<a href="https://system.data.sqlite.org/sqlite-netFx40-static-binary-x64-2010-1.0.76.0.zip">Precompiled Statically-Linked Binaries for 64-bit Windows (.NET Framework 4.0), separate native and managed assemblies</a>