Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On some computers application can't load sqlite dll file

I wrote an application that uses sqlite and it works great on most of the systems. It is written in C#, and the only non-framework assembly is sqlite, which is included by System.Data.SQLite.dll .

I deploy it the same way on all of the machines (copy pasting the exe file, the database file and the System.Data.SQLite file). It works great for all my PC's and most of the PC's I've tried.

But then I've got reports that for some people it throws the following exception:

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.

Now I've made sure the dll file is in the same folder than the application exe file. It's the same dll, with the same version as stated in the exception message above.

I was really confused by this, so I created a fresh virtual machine, installed windows 7 professional on it, and just copy pasted the files, and the thing worked. So if it works on a fresh windows, I can't imagine what the other PC's could be missing...

Note: Two of those machines where the project throws the exception are also running windows 7 proffesional.

I would really appreciate any help on this, because I'm fresh out of ideas...

like image 668
David Božjak Avatar asked Oct 25 '09 19:10

David Božjak


1 Answers

Here's a possibility: Is the difference between the working and not-working machines 32-bit vs. 64-bit? Are you building for "Any CPU", when you should be building for just the bitness of your external DLL?

like image 109
RichieHindle Avatar answered Nov 15 '22 06:11

RichieHindle