sqlite不起作用! [英] sqlite doesnt work !
问题描述
SQLiteConnection.CreateFile(database.sqlte);
^这是我的所有程序包含的内容..
它说,当我尝试编译时,这个。
为什么?
我该怎么办?
未处理的异常:System.BadImageFormatException:无法加载文件或装配
mbly'System.Data.SQLite,Version = 1.0.93.0 ,Culture = neutral,PublicKeyToken = db93
7bc2d44ff139'或其中一个依赖项。试图以不正确的格式加载程序
。
SQLiteConnection.CreateFile("database.sqlte");
^ this is the all my program contains..
And it says, when I try to compile it, this.
Why ?
What should I do ?
Unhandled Exception: System.BadImageFormatException: Could not load file or asse
mbly 'System.Data.SQLite, Version=1.0.93.0, Culture=neutral, PublicKeyToken=db93
7bc2d44ff139' or one of its dependencies. An attempt was made to load a program
with an incorrect format.
推荐答案
System.BadImageFormatException
表示你使用的是不兼容的dll库,其中on是32位而另一个是64位,因为SQLITE是ac库,你需要确保你的系统上有正确的(32/64位)。 />
尝试编译你的.net应用程序目标CPU
到x86
而不是任何CPU
(在64位操作系统上将是64位)[在项目文件中的c#编译器设置下]
另请阅读: http://stackoverflow.com/questions/18163354 / sqlite-dll-for-x86-x64-architecturalures [ ^ ]
System.BadImageFormatException
means you are using incompatible dll libraries where on is 32 bit and the other is 64 bit, since SQLITE is a c library you need to make sure you have the right one on your system (32/64 bit).
Try compiling your .net appTarget CPU
tox86
instead ofAny CPU
(which on a 64 bit OS will be 64 bit) [under c# compiler settings in the project file]
Read this also : http://stackoverflow.com/questions/18163354/sqlite-dll-for-x86-x64-architectures[^]
这篇关于sqlite不起作用!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!