SQLite User Forum

Where should the SQLite.Interop.dll go?
Login

Where should the SQLite.Interop.dll go?

(1) By Tony S (tonyATMS) on 2022-08-23 16:00:33 [source]

Whenever in install my program, on my computer or another test computer, I am getting this message all the time:

Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found.

The SQLite.Interop.dll file is in the Release/bin/x64 folder, also in the x64/Release/app.publish/x64 folder, and in a few other folders.

Can someone help? Where can I put the SQLite.Interop.dll file so it can be found? Thanks.

(2.2) By Chris Locke (chrisjlocke1) on 2022-08-23 17:25:04 edited from 2.1 in reply to 1 [link] [source]

The 'System.Data.SQLite.dll' file (I usually take the one from the x86 archive) just needs to go into the 'root' directory where your .exe is.

You then create an x86 and x64 directory, and place in there the x86 and x64 versions of the 'SQLite.Interop.dll' file - so different files/sizes.

Final directory structure:

<bin>\App.exe (optional, managed-only application executable assembly)
<bin>\App.dll (optional, managed-only application library assembly)
<bin>\System.Data.SQLite.dll (required, managed-only core assembly)
<bin>\System.Data.SQLite.Linq.dll (optional, managed-only LINQ assembly)
<bin>\System.Data.SQLite.EF6.dll (optional, managed-only EF6 assembly)
<bin>\x86\SQLite.Interop.dll (required, x86 native interop assembly)
<bin>\x64\SQLite.Interop.dll (required, x64 native interop assembly)

This information is taken from this page:

https://system.data.sqlite.org

in install my program

I assume you're referencing SQLite.Interop.dll - that's the only file you need to point to. I assume you're using Visual Studio? Is this a C# or VB.Net application? (not that it really matters, but I have more experience in vb.net)

(3) By Tony S (tonyATMS) on 2022-08-25 19:39:58 in reply to 2.2 [link] [source]

Thanks for that info. I am using Visual Studio 2022, and my program is in Visual Basic. I put the SQLite.Interop.dll in the Project and the /bin directories and that seemed to work all right. I published the program and installed it in my wife's Windows 11 computer and it worked all right, so everything's good so far. Thanks again.

(4) By anonymous on 2023-05-10 09:22:47 in reply to 2.2 [link] [source]

I am using VS 2022 to create my C# project and I have followed the correct steps but I still have the ERROR.How can I solve it? Thanks a lot!

(5) By Larry Brasfield (larrybr) on 2023-05-10 09:36:37 in reply to 4 [link] [source]

If you had followed "the correct steps", you would not have the subject problem.

Things to check (or some more correct steps to follow):

  1. Make sure the DLLs are where Chris Locke said. Be sure those directories are related to the location of the .exe constituting your application.

  2. Make sure that the bittedness of the SQLite.Interop.dll DLL(s) matches where you put it (or them).

More generally:

It is useless to post something like: "I've done everything perfectly, but it does not work. How can I make it work?" More details are needed.

(7) By Chris Locke (chrisjlocke1) on 2023-05-10 13:10:48 in reply to 5 [link] [source]

If you had followed "the correct steps", you would not have the subject problem

There is an annoying thing with Windows in that if a dependency file can't be found, it fails and throws the same error, so 'technically', they could have followed the above steps, but not installed the c++ runtime.

(6.2) By Chris Locke (chrisjlocke1) on 2023-05-10 13:13:25 edited from 6.1 in reply to 4 [link] [source]

but I still have the ERROR

What error? While I have a great set of crystal balls, they're not useful in determining your error.

Ensure the files you're referencing in your project are the same ones you've got in your directory .. ie, if you're updating from sqlite.interop.dll v111 to v115, you can't just replace the physical files .. you have to change the reference in your project too.

Also, on the download page, note this line.
"All downloadable packages on this web page that do not include the word "static" in their file name require the appropriate version (e.g. 2005, 2008, 2010, 2012, 2013, 2015, 2017) of the Microsoft Visual C++ Runtime Library, to be successfully installed on the target machine, prior to making use of the executables contained therein."

So make sure you have installed the runtime .. or the error you get is the same 'module could not be found'.