Unable to load DLL 'SQLite.Interop.DLL'

2

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 of the executable.

I also tried copying the two libraries to C:\windows\system32 and C:\windows\SysWOW64

As references in the project I have System.Data.SQLite , I wanted to add the other one to try and it appears:

    
asked by Alejandro Ricotti 12.09.2016 в 20:24
source

2 answers

3

Well the solution starts with a forced explanation and a sample of what your exit points may be.

For starters explain that to use SQLite it is very important to know in which architecture we are compiling . Since compiling in x86 SQLite.Interop.dll is one and in x64 it is another.

Taking into account that in some machines as you say it works (like me) it cost me a little more but I discovered where the problem comes from.

The problem is that for sure on those machines you do not have the Microsoft Visual C ++ 2010 Redistributable Package (x86) installed

Blessed: link

I have installed the two packages (x64 and x86) in my development machine but in the computer I had the same problem that you just downloaded the Redistributable Package (x86) and stop 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:

  • Transport the System.Data.SQLite from x86 to the same root directory of the application.
  • Transport the SQLite.Interop.dll from x86 to the same root directory of the application.
  • Have the Microsoft Visual C ++ 2010 Redistributable Package (x86) installed.
  • answered by 14.09.2016 / 19:35
    source
    2

    It solved me by installing System.Data.SQLite from the Nuget.

    You install the first and the other 3 are installed.

        
    answered by 11.09.2017 в 17:30