I have two versions of System.Data.SQLite.DLL – for x86 and x64 platform. The x86 version keeps in application folder and x64 version keeps in appFolder\x64 folder.
The application compiled as AnyCPU.
How can i load needed version of SQLite according to windows platform?
I have two versions of System.Data.SQLite.DLL – for x86 and x64 platform. The x86
Share
If you are using SQLite from http://system.data.sqlite.org, the System.Data.SQLite.DLL is completely managed. There is an underlying native DLL, SQLite.Interop.DLL, that needs to change depending on the process (32- or 64-bit).
I deploy the native libraries in “.\Native\X64” for 64-bit and “.\Native\X86” for 32-bit. At runtime P/Invoke SetDllDirectory to set the DLL load directory pointing at the correct path for the process.
http://msdn.microsoft.com/en-us/library/ms686203(v=vs.85).aspx
(Note that I’m not familiar with the architecture of the legacy System.Data.SQLite.DLL version from http://sqlite.phxsoftware.com)