4

I developed a SQLite/C# application on Windows and am deploying it on a Ubuntu server.

I downloaded the pre-compiled DLLs for MONO here https://system.data.sqlite.org/downloads/1.0.104.0/sqlite-netFx451-binary-Mono-2013-1.0.104.0.zip

I downloaded the source code and compiled libSQLite.Interop.so using this script, and then moved libSQLite.Interop.so into the website's bin folder alongside the other DLLs https://system.data.sqlite.org/index.html/artifact?ci=trunk&filename=Setup/compile-interop-assembly-release.sh

It still complains about System.DllNotFoundException: SQLite.Interop.dll. I tried renaming libSQLite.Interop.so to SQLite.Interop.dll and that doesn't help.

What else do I need to do to get SQLite(EF6) to run on MONO on Ubuntu?

Etienne Charland
  • 3,424
  • 5
  • 28
  • 58
  • Related - https://stackoverflow.com/questions/31152451/mono-on-mac-dllnotfoundexception-despite-sqlite-interop-dll-being-in-dllmap – sashoalm Dec 10 '17 at 07:58
  • Possible duplicate of [System.DllNotFoundException on Mono SQLite](https://stackoverflow.com/questions/21293105/system-dllnotfoundexception-on-mono-sqlite) – sashoalm Dec 10 '17 at 10:10

2 Answers2

0

I fix familliar problem by acting as http://blog.wezeku.com/2016/10/09/using-system-data-sqlite-under-linux-and-mono/ telled.

You may clone source codes, and compile it in specific linux-env. A shortcut:

Building System.Data.SQLite Interop under Linux
There’s no System.Data.SQLite package for Linux, so you’ll have to build it yourself on your target Linux machine. You can build using this procedure, which is tested in Raspbian Jessie on a Raspberry Pi 3 and Ubuntu 16.04.1 on a PC:

Download System.Data.SQLite full source code from this download page. There’s a ton of files there, and the one you should look for is named something like sqlite-netFx-full-source-<version no>.zip.
Unzip it and transfer it to a directory on your Linux machine. In the rest of this description, I’ll call this directory “<source root>”.
Issue these commands in a Linux terminal:
sudo apt-get update
sudo apt-get install build-essential
cd <source root>/Setup
chmod +x compile-interop-assembly-release.sh
./compile-interop-assembly-release.sh
Now, you will have a freshly built library file called libSQLite.Interop.so in the <source root>/bin/2013/Release/bin directory. This file might have execution permission which isn’t relevant for a library, so remove it by
chmod -x <source root>/bin/2013/Release/bin/libSQLite.Interop.so
Copy libSQLite.Interop.so the directory where your Mono/.NET application’s binaries reside (not the x64 or x86 subdirectories containing SQLite.Interop.dll), and you’re set to go.
And that, ladies and gentlemen, is how we do that!
Luppiter
  • 73
  • 1
  • 13
-2

Do not use the interop version at all, instead stick to the libmono-sqlite4.0-cil package which you probably already have installed. If the sqlite dll is deployed with your application, delete it so the system picks up the packaged version from the GAC.

Jester
  • 56,577
  • 4
  • 81
  • 125