64 位 SQLite.dll 和任何 CPU
经过一段时间试图解决这个问题后,我终于决定在这里发布一个问题。几天前,我在 sqlite 论坛上发布了同样的问题,但该网站目前不可用。 http://sqlite.phxsoftware.com/forums/t/2669.aspx
所以,问题是: 我有 64 位计算机和 64 位操作系统。一位同事拥有带有 32 位操作系统的 64 位计算机。我们开发了一个 Web 应用程序,它从服务器获取大量数据并将其保存在内存 SQLite 数据库中,因此一切都可以运行得更快。现在我们在两台机器上都使用 32 位 SQLite.dll。然而,我们希望切换到 64 位 dll(并增加我们可以使用和存储的数据量)。我已经从 http://system.data.sqlite 下载.org/index.html/doc/trunk/www/downloads.wiki 以下文件:sqlite-dotnet-x64-1007300.exe 并安装在我的计算机上。我已将 System.Data.Sqlite.dll 和 System.Data.Sqlite.Linq.dll 放入 lib 文件夹中,同时将 Sqlite.Interop.dll 复制到 bin\Debug 文件夹中。 当我使用任何 CPU 调试应用程序时,我的机器上一切正常,但是我的同事却遇到错误。
我想使用 64 位 dll 并使用任何 CPU 构建 exe 文件,而不用担心系统是 32 位还是 64 位。这可能吗?如果这是我应该做的来实现这一目标? 提前致谢!
PS我们使用C# - Visual Studio 2008 3.5 SP1
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
今天,您不必再这样做了。只需确保像这样捆绑两个互操作 DLL:
System.Data.SQLite.dll
将根据平台找到正确的一个。Today, you don't have to any more. Just make sure you bundle both interop DLLs like this:
and the
System.Data.SQLite.dll
will find the correct one depending on the platform.我想您必须同时提供 32 位和 64 位 SQLite.dll,并根据目标系统体系结构安装其中之一。
I guess that you'll have to ship both 32 bit and 64 bit SQLite.dlls, and install one or the other depending on the target system architecture.
只需从 nuget 安装它。它将安装两个版本,并将它们复制到单独的文件夹中并根据目标系统使用。只需将构建模式设置为“任何 CPU”即可开始!
从此处。
Just install it from nuget. It will install both builds and they will be copied in separate folders and used based on the target system. Just set your build mode to Any CPU and you are good to go!
From here.