c# - SQLite 的 dotConnect 包不适用于 VS2013 中的 64 位 C# 项目?

标签 c# visual-studio sqlite dotconnect

这是来自

的后续问题
  http://stackoverflow.com/questions/36166266/sqlite3-dll-cannot-be-used-in-c-sharp-application-in-vs2013-on-win-7/36169278#36169278

我安装了 dotConnect.Express.for.SQLite

https://www.nuget.org/packages/dotConnect.Express.for.SQLite/

现在,对于 32 位的 C# 项目,它可以工作了。但是,对于 x64,我收到错误:

 An unhandled exception of type 'System.IO.FileLoadException' occurred in XMR.UserModel.dll

  Additional information: Could not load file or assembly 'Devart.Data.SQLite, Version=5.2.457.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

.net 似乎需要 x64 版本,但安装的“dotConnect”是 32 位?

有什么建议吗?

最佳答案

用于 SQLite 程序集的 dotConnect 是使用/platform:anycpu 选项构建的。因此,您可以在任何平台(x86 或 x64)上使用提供程序的程序集。欲了解更多信息,请参阅http://msdn.microsoft.com/en-us/library/zekwfyz4.aspx .

但是,您需要确保您使用的是兼容版本的引擎库sqlite3.dll。在安装桌面 dotConnect for SQLite 期间部署适当容量的引擎库版本。要获取 sqlite3.dll 的两个版本(x86 和 x64),请从 https://www.devart.com/dotconnect/sqlite/download.html 安装适用于 SQLite Express 的桌面 dotConnect 。默认情况下,安装会将这些文件放在这里:

  • C:\Program Files (x86)\Devart\dotConnect\SQLite\sqlite3.dll

  • C:\Program Files (x86)\Devart\dotConnect\SQLite\x64\sqlite3.dll

部署时,创建一个名为“x86”(不带引号)或“x64”(不带引号)的文件夹,并将其放置在包含应用程序程序集的文件夹中。这是 dotConnect for SQLite 查找 sqlite3.dll 的第一个地方。

关于c# - SQLite 的 dotConnect 包不适用于 VS2013 中的 64 位 C# 项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36178700/

相关文章:

c# - 使用 Microsoft.Azure.WebJobs.Extensions.ServiceBus 5.5.1 以编程方式设置连接字符串

c# - 如何对该方法进行单元测试

performance - 最佳Visual Studio硬件升级

android - 仅当值不为 null android 时才更新 sqlite 数据库

java - Android:SQLite 使用了错误的数据库

ios - 如何在 Swift 中将 UITableView 的单元格文本设置为数据库单元格的内容?

c# - 获取 Canvas 背景的画笔控件的实际大小

c# - 用于检测 WinForms 中 SQL 注入(inject)的正则表达式

c# - 命名空间中的特殊字符

visual-studio - 负载测试经过身份验证的用户