I have added the System.Data.SQLite.Core
NuGet package to my LINQPad 5 Query (Premium) and then try to execute the following:
new SQLiteConnection(":memory:").Dump();
But I get:
DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
How can I tell LINQPad where to find the SQLite Native DLLs?
Please note I do not want to use the IQ Driver.
This library is not referenced in the standard way, because it's native and requires different images for X86 and X64.
A workaround in LINQPad is to locate the following folder:
%localappdata%\LINQPad\NuGet.FW46\System.Data.SQLite.Core\System.Data.SQLite.Core.1.0.99.0\build\net46
and copy the X86 and X64 subfolders into the folder where LINQPad.exe is located.
Another solution, based on this comment in the LINQPad forum, is to do the following:
Add the following code to your LINQPad query:
System.Environment.SetEnvironmentVariable(
"PreLoadSQLite_BaseDirectory",
@"C:\path\to\which\you\copied\the\files\and\directories\in\steps\one\and\two");
The advantage of this relative to the answer submitted by Joe Albahari (the creator of LINQPad by-the-way!) is that this could be readily included in a Git repo (were you to be storing your LINQPad query thusly).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With