This is the error that appears on some computers when I run my application, I have the libraries SQLite.Interop.dll
and System.Data.SQLite.dll
in the same directory as the executable.
I also tried copying the two libraries to C:\windows\system32
andC:\windows\SysWOW64
As references in the project I have System.Data.SQLite
, I wanted to add the other one to test and it appears:
Well the solution begins with a required explanation and a sample of what your exit points can be.
To begin with, explain to you that in order to use SQLite it is very important to know what architecture we are compiling on . Since when compiling in x86 SQLite.Interop.dll is one and in x64 it is another.
Taking into account that on some machines, as you say, it works for you (as it does for me) it cost me a little more but I discovered where the problem comes from.
The problem is that surely on those machines you do not have the Microsoft Visual C++ 2010 Redistributable Package (x86) installed.
Blessed: https://www.microsoft.com/en-gb/download/details.aspx?id=5555
I have installed both packages (x64 and x86) on my development machine but on the computer that had the same problem as you, I only downloaded the Redistributable Package (x86) and stopped having the same error window like yours.
In summary:
If I compile my project in x86 (for 32 bits) I have to take into account:
It was solved for me by installing
System.Data.SQLite
from Nuget.You install the first one and the other 3 are installed.
This worked for me, since I had the same problem after installing System.Data.SQLite by Nuget: Unable to load DLL 'SQLite.Interop.dll'
UPDATE: It must be installed by Nuget
System.Data.SQLite
orSystem.Data.SQLite.Core
in the case of only NET Framework, then in the project two folders called x86 and x64 must be created, in each one it must be addedSQLite.Interop.dll
depending on the architecture, this dll is found in the folderpackages
that is created when installing the Nuget, for example:The folder
build
contains several subfolders for different versions of the .NET Framework.Finally, in each of the added dlls, the property must be changed in the properties window: "Change in the output directory" from "Do not copy" to "Copy always" .