I am getting the following error in my Web project in Visual Studio 2017:
Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Now, I have read ALL of the other StackOverflow questions with the same or similar titles and NONE of the mentioned solutions have worked for me.
The strangest thing is that the SQLite.Interop.dll file is inside my \bin folder and inside both x86 and x64.
Fusion log is enabled but it doesn't seem to pick this up at all.
It "feels" to me like something is being cached by my IIS.
Here is some more detail about my environment and what I'm doing:
Further, I've got a base project where this actually works.
I am converting this to a Visual Studio template, exporting it and then I create a new project of my custom visual studio template type.
It is this newly created project that does not want to work. In fact, when i run the first time, visual studio downloads all the nuget packages but does not copy the sqlite.interop.dll files over.
Only when I re-build the solution a second time, does it copy the files over.
But I still get the error.
So I want to emphasize, the actual dll's (SQLite.Interop.dll) do exist in the bin directory, and the IIS website is hosted in that directory.
But I still get this error.
Is there any reason why this is happening??
I have a feeling it might be related to the Visual Studio template, but i can't see any difference with my manually created project and the template created one. But I would think this is sort of besides the point, why am I getting the error?
Any help is appreciated.
I also had this error for a while while trying to work in an Entity Framework designer edmx file.
I finally found the solution from the SQLite FAQ https://system.data.sqlite.org/index.html/doc/trunk/www/faq.wiki#q10
(11) Why do I get a DllNotFoundException (for "sqlite3.dll" or "SQLite.Interop.dll") when trying to run my application?
Either the named dynamic link library (DLL) cannot be located or it cannot be loaded due to missing dependencies. Make sure the named dynamic link library is located in the application directory or a directory along the system PATH and try again. Also, be sure the necessary Visual C++ runtime redistributable has been installed unless you are using a dynamic link library that was built statically linked to it.
So I simply copied the SQLite.Interop.dll to somewhere referenced by the PATH variable (I was lazy so I simply dropped it in C:\Windows). I did not had to manually select x86 or x64 for my project, it still uses Any CPU and now everything works.
User contributions licensed under CC BY-SA 3.0