Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.BadImageFormatException with Sqlite

Tags:

sqlite

wpf

I am trying to use SQLite with my WPF application. I can get the reads and writes to work ok. The only problem I have is that my xaml is not displaying and I get the following error:

System.BadImageFormatException Could not load file or assembly 'System.Data.SQLite, Version=1.0.80.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.

My questions: -How do I know what version of SQLite that I am using? 32bit or 64bit? -I tried changing the Platform target to x86 and x64 but neither help. How can I resolve this error?

like image 486
Jerry Avatar asked Oct 22 '25 04:10

Jerry


1 Answers

Had same problem when used 64-bit precompiled binaries. Solution is use 32-bit ones instead (manually download them from SQLite site if needed).

like image 148
Jaded Avatar answered Oct 23 '25 20:10

Jaded