0

I have currently an issue with the SQLite.Interop.dll. My Application is a .net code-based rest server targeted at the netcoreapp3.1 Framework. It is being deployed via VS Powershell with the command

dotnet -c release -r linux-arm

for a raspbian os. The linux-arm is being used since it is an armv7l kernel.

The Server is running fine until I open a specific interface that uses SQLite to access the database. It then throws these exceptions:

System.EntryPointNotFoundException: Unable to find an entry point named 'SI7fca2652f71267db' in shared librar
    at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
    at System.Data.SQLite.SQLite3.StaticIsInitialized()
    at System.Data.SQLite.SQLiteLog.PrivateInitialize(String className)
    at System.Data.SQLite.SQLiteLog.Initialize(String className)
    at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
    at System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
    at RestApplication.Class.Class_SAPTyreDatabase.CreateConnection() in D:\****\VisualStudio2019\RestApplicat
    at RestApplication.Class.Class_SAPTyreDatabase..ctor(String sqliteConnectionString) in D:\****\VisualStudi
    at RestApplication.Controllers.SapInterfaceController..ctor() in D:\****\VisualStudio2019\RestApplication\
    at lambda_method(Closure , IServiceProvider , Object[] )
    at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass4_0.<CreateActivator>
    at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFa
    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object&
    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
 --> End of stack trace from previous location where exception was thrown ---
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(Resou
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, 
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
 --> End of stack trace from previous location where exception was thrown ---
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker in
    at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task
    at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMidd

It then restarts the service and gives out this exception:

System.DllNotFoundException: Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies. 
    at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)

I looked it up in other threads and it was suggested that I have to add the required DLL to the application directory since there is an issue with the deployment. The sqlite wiki also described adding the dll to an x64 / x86 folder. But I was not sure which version to download.

  • I added the 2 interop files as described here: github
  • I was not sure which version of the dll from the SQLite side to add to the folders as described in here: stackoverflow
  • Here is the download site with the different libraries: sqlite.org
  • I edited my project file with the additional propertygroup: stackoverflow
Carnefix
  • 11
  • 4
  • and why are you using this instead `Microsoft.Data.Sqlite` package ? `SQLite.Interop` seems to be only for windows – Selvin Nov 24 '22 at 14:17
  • Hi, I did not install or reference SQLite.Interop in the first place. I only installed the NuGet package for System.Data.SQLite.Core and wrote my Application in VS19 and deployed it from there to my Raspi. The exception was then thrown out without me referering to it. – Carnefix Nov 24 '22 at 14:28
  • From what I can see, System.Data.Sqlite doesn't support armv7l, but Microsoft.Data.Sqlite does? Have you tried using Microsoft.Data.Sqlite instead of System.Data.Sqlite? – canton7 Nov 24 '22 at 14:32
  • Yes. I did try that as well. – Carnefix Nov 24 '22 at 16:17
  • Thanks for the help. I did switch my SQL Server in the end and made it work with MySQL as I was not able to find a solution – Carnefix Nov 24 '22 at 16:56

0 Answers0