我已经破碎代码到尽可能小的语句:
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。