Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
288 views
in Technique[技术] by (71.8m points)

c# - 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 binDebug 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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

path_to_exeSystem.Data.SQLite.dll
path_to_exex64SQLite.Interop.dll
path_to_exex86SQLite.Interop.dll

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...