How to get Sqlite database in .NET Core application to deploy onto Linux


I have a .NET Core application that I have created on Windows in Visual Studio.

I've managed to deploy the application to Rasbian and Windows using publish in Visual Studio. However, I'm struggling to get the database to work.

I'm quite inexperienced with databases. I chose sqlite in the hopes that I could get it to work on Linux.

This is the error I get:

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module or one of its dependencies could not be found.
 (Exception from HRESULT: 0x8007007E)
   at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
   at System.Data.SQLite.SQLite3.StaticIsInitialized()
   at System.Data.SQLite.SQLiteLog.Initialize(String className)
   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
   at ShareThis.Server.FilesDatabase..ctor(String databaseName) in C:\Users\josef\source\repos\ShareThis\ShareThis\Server\FilesDatabase.cs:line 13
   at ShareThis.Server.ShareThis.HandleClient(Object obj) in C:\Users\josef\source\repos\ShareThis\ShareThis\Server\ShareThis.cs:line 256
   at System.Threading.Thread.ThreadMain_ParameterizedThreadStart(Object parameter)
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

I've been searching the internet for hours trying to compile the dll but I'm at a loss now.

asked on Stack Overflow Mar 8, 2019 by joe williams

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0