我已经打破了code降低到尽可能小的语句:
I've broken the code down to the smallest possible statement:
Dim cn As System.Data.SQLite.SQLiteConnection和我从一个WinForm应用程序了调用code当出现以下错误:
And I get the following error when calling the code from a WinForm applicaiton:
System.BadImageFormatException:可能 无法加载文件或程序集 System.Data.SQLite,版本= 1.0.65.0, 文化=中立, 公钥= db937bc2d44ff139或 它的一个依赖。尝试 是为了用一个加载程序 格式不正确。文件名: System.Data.SQLite,版本= 1.0.65.0, 文化=中立, 公钥= db937bc2d44ff139
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, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'
然而,呼吁从MS单元测试的同一块code我不明白的错误,再加上全code组按预期工作。
Yet calling the same piece of code from MS Unit Test I do not get the error, plus the full code set works as expected.
推荐答案SqlLite包含非托管code,你不能在64位操作系统上运行它,除非你部署64位版本。快速修复:项目+属性,生成标签,平台目标= 86
SqlLite contains unmanaged code, you can't run it on a 64-bit operating system unless you deploy the 64-bit version. Quick fix: Project + Properties, Build tab, Platform Target = x86.
更多推荐
构建System.Data.SQLite.SQLiteConnection时,是什么原因导致System.BadImageFormatException
发布评论