corflags.exe,system.data.sqlite.dll和badimageFormateXception
-
25-10-2019 - |
题
跑步 corflags.exe 反对 System.Data.SQLite.dll
从 http://sqlite.phxsoftware.com/ 产生以下输出。
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 24
ILONLY : 0
32BIT : 0
Signed : 1
如你看到的, 32BIT
未指定, PE
等于 PE32
. 。根据 从32位移至.NET框架上的64位应用程序开发, ,这意味着大会是 任何CPU. 。但是,使用来自64位应用程序的组件会导致错误:
system.badimageFormateXception:无法加载文件或汇编'System.data.sqlite'或其依赖项之一。试图使用不正确的格式加载程序。文件名:'system.data.sqlite'
如果corflags.exe正在报告 任何CPU, ,为什么发生例外?是错误标记的组装吗 32BIT: 0
?
我知道也有一个64位版本可用,我只想知道是什么原因导致错误。
解决方案
您正在使用的system.data.sqlite.dll文件是一个 混合模式组件, ,这意味着它不是纯的.NET代码(另请参见“ Ilonly:0”标志),它还包含非管理机器代码,而不是“任何CPU”。因此,由于DLL包含32位本机代码,因此只能将其加载到32位过程中,否则会发生BadImageFormateXception。
其他提示
If you download the SQLite-1.0.66.0-binaries.zip
file from sourceforget.net then this contains a bin/x64 directory with a System.Data.SQLite.dll
file which is what you are looking for.
It also has an Itanium directory too..
The URL is:
http://sourceforge.net/projects/sqlite-dotnet2/files/SQLite%20for%20ADO.NET%202.0/1.0.66.0/