SQLite on Linux Arm64

I am trying to run a project on my Arm64 server that uses ServiceStack.OrmLite.Sqlite. If I run locally on windows it works fine but on linux docker image on Arm64 it gives this exception:

logintest  | info: ServiceStack.ServiceStackHost[0]
logintest  |       Initializing Application api took 260.179ms. No errors detected.
logintest  | Unhandled exception. System.DllNotFoundException: Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
logintest  | /app/runtimes/linux-arm64/native/SQLite.Interop.dll.so: cannot open shared object file: No such file or directory
logintest  | /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.14/SQLite.Interop.dll.so: cannot open shared object file: No such file or directory
logintest  | /app/SQLite.Interop.dll.so: cannot open shared object file: No such file or directory
logintest  | /app/runtimes/linux-arm64/native/libSQLite.Interop.dll.so: cannot open shared object file: No such file or directory
logintest  | /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.14/libSQLite.Interop.dll.so: cannot open shared object file: No such file or directory
logintest  | /app/libSQLite.Interop.dll.so: cannot open shared object file: No such file or directory
logintest  | /app/runtimes/linux-arm64/native/SQLite.Interop.dll: cannot open shared object file: No such file or directory
logintest  | /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.14/SQLite.Interop.dll: cannot open shared object file: No such file or directory
logintest  | /app/SQLite.Interop.dll: cannot open shared object file: No such file or directory
logintest  | /app/runtimes/linux-arm64/native/libSQLite.Interop.dll: cannot open shared object file: No such file or directory
logintest  | /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.14/libSQLite.Interop.dll: cannot open shared object file: No such file or directory
logintest  | /app/libSQLite.Interop.dll: cannot open shared object file: No such file or directory
logintest  |
logintest  |    at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
logintest  |    at System.Data.SQLite.SQLite3.StaticIsInitialized()
logintest  |    at System.Data.SQLite.SQLiteLog.PrivateInitialize(String className)
logintest  |    at System.Data.SQLite.SQLiteLog.Initialize(String className)
logintest  |    at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
logintest  |    at System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
logintest  |    at ServiceStack.OrmLite.Sqlite.SqliteOrmLiteDialectProvider.CreateConnection(String connectionString) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack.OrmLite/src/ServiceStack.OrmLite.Sqlite/SqliteOrmLiteDialectProvider.cs:line 26
logintest  |    at ServiceStack.OrmLite.Sqlite.SqliteOrmLiteDialectProviderBase.CreateConnection(String connectionString, Dictionary`2 options) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack.OrmLite/src/ServiceStack.OrmLite.Sqlite/SqliteOrmLiteDialectProviderBase.cs:line 209
logintest  |    at ServiceStack.OrmLite.OrmLiteConfig.ToDbConnection(String dbConnectionStringOrFilePath, IOrmLiteDialectProvider dialectProvider) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack.OrmLite/src/ServiceStack.OrmLite/OrmLiteConfig.cs:line 168
logintest  |    at ServiceStack.OrmLite.OrmLiteConnection.get_DbConnection() in /home/runner/work/ServiceStack/ServiceStack/ServiceStack.OrmLite/src/ServiceStack.OrmLite/OrmLiteConnection.cs:line 40
logintest  |    at ServiceStack.OrmLite.OrmLiteConnection.Open() in /home/runner/work/ServiceStack/ServiceStack/ServiceStack.OrmLite/src/ServiceStack.OrmLite/OrmLiteConnection.cs:line 119
logintest  |    at ServiceStack.OrmLite.OrmLiteConnectionFactory.OpenDbConnection() in /home/runner/work/ServiceStack/ServiceStack/ServiceStack.OrmLite/src/ServiceStack.OrmLite/OrmLiteConnectionFactory.cs:line 95
logintest  |    at ServiceStack.OrmLite.OrmLiteConnectionFactoryExtensions.Open(IDbConnectionFactory connectionFactory) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack.OrmLite/src/ServiceStack.OrmLite/OrmLiteConnectionFactory.cs:line 228
logintest  |    at api.ConfigureDb.<>c.<Configure>b__0_2(IAppHost host) in /src/api/Configure.Db.cs:line 41
logintest  |    at ServiceStack.ServiceStackHost.Init() in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/ServiceStackHost.cs:line 341
logintest  |    at ServiceStack.NetCoreAppHostExtensions.UseServiceStack(IApplicationBuilder app, AppHostBase appHost, Action`1 configure) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/AppHostBase.NetCore.cs:line 773
logintest  |    at api.Program.Main(String[] args) in /src/api/Program.cs:line 68

I’ve been googling the issue and I saw some posts where people say I need to copy the interop files somewhere but I am not sure from where to where.

See OrmLite Install Docs for all the different providers available, e.g. For cross-platform SQLite you should use:

<PackageReference Include="ServiceStack.OrmLite.Sqlite.Data" Version="8.*" />
1 Like

Ahh, I had that one installed but I also had ServiceStack.OrmLite.Sqlite. Removing that made it work.

Thank you sir!