Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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.
Posted

1 solution

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 app Target CPU to x86 instead of Any 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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900