Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

64-bit SQLite.dll and Any CPU

I finally decided to post a question here after some time spent trying to figure out this problem. A few days ago I posted this same question on sqlite forum but that website is currently not available . http://sqlite.phxsoftware.com/forums/t/2669.aspx

So, here is the question: I have 64-bit computer with 64-bit OS. A co-worker has 64-bit computer with 32-bit OS. We develop a web application that brings a lot of data from server and keeps it in memory SQLite database, so everything can run faster. Right now we use 32-bit SQLite.dll on both machines. However we want to switch to 64-bit dll (and increase amount of data we can use and store). I have downloaded from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki folowing files: sqlite-dotnet-x64-1007300.exe and instaled on my machine. I have placed System.Data.Sqlite.dll and System.Data.Sqlite.Linq.dll into lib folder, while I have copied Sqlite.Interop.dll into bin\Debug folder. When I debug application by using Any CPU everything works fine on my machine, however, my co-worker is getting errors.

I want to use 64-bit dll and build exe file using Any CPU and not worry if the system is 32 or 64. Is that possible? And if it is what I should do to accomplish that? Thanks in advance!

P.S. We use C# - Visual Studio 2008 3.5 SP1

like image 529
EsEs Avatar asked Dec 22 '22 12:12

EsEs


1 Answers

Today, you don't have to any more. Just make sure you bundle both interop DLLs like this:

path_to_exe\System.Data.SQLite.dll
path_to_exe\x64\SQLite.Interop.dll
path_to_exe\x86\SQLite.Interop.dll

and the System.Data.SQLite.dll will find the correct one depending on the platform.

like image 127
Gábor Avatar answered Dec 24 '22 02:12

Gábor