System.Data.Sqlite default Nuget package will not work in Ubuntu / Mono.
This error will occur:
copying over SQLite.Interop.dll to the bin folder didn't fix the issue.
the solution is to download Sqlite source code and build it yourself using this command:
This error will occur:
System.TypeInitializationException: The type initializer for 'System.Data.SQLite.SQLiteFactory' threw an exception. ---> System.DllNotFoundException: SQLite.Interop.dll at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods:sqlite3_config_none (System.Data.SQLite.SQLiteConfigOpsEnum) at System.Data.SQLite.SQLite3.StaticIsInitialized () <0x4037a6f0 0x00087=""> in:0 0x4037a6f0> at System.Data.SQLite.SQLiteLog.Initialize () <0x4037a370 0x00027=""> in:0 0x4037a370> at System.Data.SQLite.SQLiteFactory..cctor () <0x403645f0 0x00057=""> in:0 0x403645f0> --- End of inner exception stack trace ---
copying over SQLite.Interop.dll to the bin folder didn't fix the issue.
the solution is to download Sqlite source code and build it yourself using this command:
MSBuild System.Data.SQLite.2012.csproj /t:Rebuild /p:UseInteropDll=false /p:UseSqliteStandard=true
here is a download link to save you time: