C
C#3mo ago
Bubba

✅ Use Sqlite in a C# project

Hello, I'm trying to use Sqlite for the first time but I'm getting the following error when creating a connection.
using System.Data.SQLite;
...
new SQLiteConnection(connectionString);
...
using System.Data.SQLite;
...
new SQLiteConnection(connectionString);
...
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 setting the DYLD_PRINT_LIBRARIES environment variable:
...
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 setting the DYLD_PRINT_LIBRARIES environment variable:
...
I installed the packages SQLite and System.Data.SQLite.Core using NuGet. Any idea? (Not sure if it's important but i'm on apple silicon)
2 Replies
Pobiega
Pobiega3mo ago
Might very well have something to do with that, sqlite in C# is a wrapper around a native dll, so you might need to find a sqlite shared library that was compiled for ARM
Bubba
BubbaOP3mo ago
Using the Microsoft.Data.Sqlite library fixed the problem :blobthumbsup:
Want results from more Discord servers?
Add your server