ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
525 stars 109 forks source link

DllNotFoundException: e_sqlite3 #400

Closed scohe001 closed 3 years ago

scohe001 commented 3 years ago

I'm attempting to use sqlite-net-pcl in a Unity project.

I've added the following DLL's to my Assets/Plugins directory:

When running, SQLite-net throws an exception:

DllNotFoundException: e_sqlite3
SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number () (at <0c6005d444974cd28bc8604fad3b12d6>:0)
SQLitePCL.raw.SetProvider (SQLitePCL.ISQLite3Provider imp) (at <5c1b545cd56d4bbda42fb802eb1e354a>:0)
SQLitePCL.Batteries_V2.Init () (at <f6de2824d7db436499a4a67aca6b7fab>:0)
SQLite.SQLiteConnection..cctor () (at <d1675684fe9e4c59aa214e635268a179>:0)
Rethrow as TypeInitializationException: The type initializer for 'SQLite.SQLiteConnection' threw an exception.

From looking through the readme on this repo, it seems I need a SQLitePCLRaw.lib.e_sqlite.dll. However, when I grab the NuGet package for that (https://www.nuget.org/packages/SQLitePCLRaw.lib.e_sqlite3/), the netstandard2.0 directory is empty.

Am I missing something here or is there a reason there's no DLL in there? Should there be some other way to get the DLL? Or do I not need it at all and my setup is wrong?

Thanks!

scohe001 commented 3 years ago

After poking around, it turns out the e_sqlite3.dll file was hiding in runtimes/win-x64/native. Throwing that in with the other DLL's got everything working.

I guess I'm just not familiar enough with the way NuGet packages things.