Search code examples
.netapple-m1.net-6.0sqlite-net

libSQLite.Interop not found Mac OS | M1


I am using dotnet 6 on a M1 Pro, and am struggling to use the SQLite-Package.

System.DllNotFoundException: Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies.

This is the error that is thrown, whenever I try to run the application. Building however works fine.


Solution

  • As a workaround to sqlite not yet targeting arm64, you can use the .net 6 x64 architecture.

    • Install .net 6 x64 from here.
    • Configure your IDE (or terminal) to use .net x64. This will vary by IDE, but in Rider:
      • Press CMD , to open preferences
      • Navigate to "Toolset and build" section
      • Change the .NET CLI executable path to /usr/local/share/dotnet/x64/dotnet

    enter image description here