ericsink / SQLitePCL.raw

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

Wrong architecture when NativeLibrary.Load cause Library e_sqlite3 not found #584

Open okt-wang opened 10 months ago

okt-wang commented 10 months ago

How can we reproduce the problem you are seeing? Your issue will get attention much faster if you attach a minimal reproduction sample project.

ericsink commented 10 months ago

My first reaction to this issue is to say that Mono and packages.config are on my list of things I'm not sure I want to support at this point.

That said, if the e_sqlite3 native binary is compatible with your OS, I suspect this could be made to work by initializing the provider manually instead of using a bundle.

Rough steps:

Get rid of bundle_e_sqlite3 and provider.dynamic_cdecl.

Keep SQLitePCLRaw.core and SQLitePCLRaw.lib.e_sqlite3

Add SQLitePCLRaw.provider_e_sqlite3

Add code to initialize things, something like this:

SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_e_sqlite3());

What I don't know is whether the proper libe_sqlite3.so will end up in "the right place" using whatever building tooling you've got. I'll stay pessimistic on that for the moment, but if you find the file and copy it to your build output directory, it should/might work.