Periodically I am getting the following exception:
Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I am using 1.0.82.0. version, installing it with nuget in VS2010, OS Win7 64.
Once exception starts to appear, it appears constantly - in debug and release and running application within or outside VS.
The only way to stop it is logoff and logon. The exception is not thrown and dll is loaded. It can work for days, but then it can break again.
Has anyone seen something like this and is there a solution for it?
Could there be contention for the assembly? Check to see whether there's another application with a file lock on the DLL.
If this is the reason, it should be easy to use a tool like Sysinternal's Process Explorer to discover the offending program.
HTH, Clay
I ran across this problem, in a solution with a WebAPI/MVC5 web project and a Feature Test project, that both drew off of the same data access (or, 'Core') project. I, like so many others here, am using a copy downloaded via NuGet in Visual Studio 2013.
What I did, was in Visual Studio added a x86 and x64 solution folder to the Feature Test and Web Projects. I then did a
Right Click | Add Existing Item...
, and added the appropriate SQLite.interop.dll library from..\SolutionFolder\packages\System.Data.SQLite.Core.1.0.94.0\build\net451\[appropriate architecture]
for each of those folders. I then did aRight Click | Properties
, and setCopy to Output Directory
toAlways Copy
. The next time I needed to run my feature tests, the tests ran successfully.There are really a lot of answers here, but mine is simple and clear with no-GAC-playing-around.
The problem was, the executable File needs a copy of the right
SQLite.Interop.dll
(x86 or x64) to access our Database.Mostly architectures have layers and in my case the Data Layer has the required DLL for SQLite Connection.
So i simple put a post build script into my Data Layer Solution and everything worked fine.
TL;DR;
x86
orx64
in the build options.Add following
Post-Build-Script
to the Project with theSQLite nuget Package
:xcopy "$(TargetDir)x64" "$(SolutionDir)bin\Debug\" /y
Of course you have to change the script for
Release Build
andx86
builds.STL;DR;
Put your
SQLite.Interop.dll
next to the*.exe
File.I had a similar issue in a multiple projects solution. The SQLite.Interop.dll was necessary for one of the plugins distributed with the software using ClickOnce.
As far as debugging in visual studio everything worked fine, but the deployed version was missing the folders x86/ and x64/ containing that DLL.
The solution to have it work after deployment using ClickOnce was to create in the startup project of the solution (also the one being published) these two subfolder, copy into them the DLLs and set them as Content Copy Always.
This way the ClickOnce publishing tool automatically includes these files and folders in the manifest and deploys the software with them
Copy "SQLite.Interop.dll" files for both x86 and x64 in debug folder. these files should copy into "x86" and "x64 folders in debug folder.
I had this problem because a dll I was using had Sqlite as a dependency (configured in NuGet with only the Sqlite core package.). The project compiles and copies all the Sqlite dll-s except the 'SQLite.Interop.dll' (both x86 and x64 folder).
The solution was very simple: just add the Sqlite.Core package as a dependency (with NuGet) to the project you are building/running and the dll-s will be copied.