.net – 什么原因导致System.BadImageFormatException时构造System.Data.SQLite.SQLiteConnection

我已经破碎代码到尽可能小的语句:
Dim cn As System.Data.SQLite.SQLiteConnection

当从WinForm应用程序调用代码时,我得到以下错误:

System.BadImageFormatException: Could
not load file or assembly
‘System.Data.SQLite,Version=1.0.65.0,
Culture=neutral,
PublicKeyToken=db937bc2d44ff139’ or
one of its dependencies. An attempt
was made to load a program with an
incorrect format. File name:
‘System.Data.SQLite,
PublicKeyToken=db937bc2d44ff139’

然而从MS单元测试I调用同一段代码没有得到错误,加上完整的代码集工作原理。

SqlLite包含非托管代码,您不能在64位操作系统上运行它,除非部署64位版本。快速修复:项目属性,构建选项卡,平台目标= x86。

相关文章

SQLite架构简单,又有Json计算能力,有时会承担Json文件/RES...
使用Python操作内置数据库SQLite以及MySQL数据库。
破解微信数据库密码,用python导出微信聊天记录
(Unity)SQLite 是一个软件库,实现了自给自足的、无服务器...
安卓开发,利用SQLite实现登陆注册功能