title: Unable to load shared library 'e_sqlite3' or one of its dependencies
body: <p>I am using the Entity Framework in combination with SQLite to make a database repository. I get the following error when running <code>dotnet run</code>.</p>
  <pre><code> Standard Error Messages:
   Exception has been thrown by the target of an invocation. -&gt; The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception. -&gt; Exception has been thrown by the target of an invocation. -&gt; Unable to load shared library 'e_sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libe_sqlite3, 1): image not found System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
    ---&gt; System.TypeInitializationException: The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception.
    ---&gt; System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
    ---&gt; System.DllNotFoundException: Unable to load shared library 'e_sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libe_sqlite3, 1): image not found
      at System.Runtime.InteropServices.NativeLibrary.LoadByName(String libraryName, QCallAssembly callingAssembly, Boolean hasDllImportSearchPathFlag, UInt32 dllImportSearchPathFlag, Boolean throwOnError)
      at System.Runtime.InteropServices.NativeLibrary.LoadLibraryByName(String libraryName, Assembly assembly, Nullable`1 searchPath, Boolean throwOnError)
      at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable`1 searchPath)
      at SQLitePCL.NativeLibrary.Load(String libraryName, Assembly assy, Int32 flags)
      at SQLitePCL.Batteries_V2.MakeDynamic(String name, Int32 flags)
      at SQLitePCL.Batteries_V2.DoDynamic_cdecl(String name, Int32 flags)
      at SQLitePCL.Batteries_V2.Init()
      --- End of inner exception stack trace ---
      at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
      at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
      at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
      at Microsoft.Data.Sqlite.Utilities.BundleInitializer.Initialize()
      at Microsoft.Data.Sqlite.SqliteConnection..cctor()
      --- End of inner exception stack trace ---
      at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)
      at Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal.SqliteRelationalConnection.CreateDbConnection()
      at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection()
      at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
      at Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal.SqliteDatabaseCreator.Exists()
      at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.EnsureCreated()
      at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.EnsureCreated()
      at POC.repository.EF.DatabaseInitializer.Initialize(DatabaseContext context, Boolean dropCreateDatabase) in /Users/niel/School/integratieproject/pocintegratieproject/POC/repository/EF/DatabaseInitializer.cs:line 16
      at POC.repository.EF.DatabaseContext..ctor() in /Users/niel/School/integratieproject/pocintegratieproject/POC/repository/EF/DatabaseContext.cs:line 11
      at POC.repository.LeerkrachtRepositoryDatabase..ctor() in /Users/niel/School/integratieproject/pocintegratieproject/POC/repository/LeerkrachtRepositoryDatabase.cs:line 15
      at SpecFlowPOC.Steps.LeerkrachtInloggenStepdefinition..ctor(ScenarioContext sctx) in /Users/niel/School/integratieproject/pocintegratieproject/SpecFlowPOC/Steps/LeerkrachtInloggenStepdefinition.cs:line 17
      --- End of inner exception stack trace ---
      at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
      at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
      at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
  
  </code></pre>
  <p>I'm using Rider on MacOS.</p>
  <p>This is my <code>.csproj</code> file:</p>
  <pre><code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk&quot;&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netstandard2.0&lt;/TargetFramework&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore&quot; Version=&quot;3.1.13&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Sqlite&quot; Version=&quot;3.1.13&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Sqlite.Core&quot; Version=&quot;3.1.13&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.SqlServer&quot; Version=&quot;3.1.13&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Tools&quot; Version=&quot;3.1.13&quot;&gt;
        &lt;PrivateAssets&gt;all&lt;/PrivateAssets&gt;
        &lt;IncludeAssets&gt;runtime; build; native; contentfiles; analyzers; buildtransitive&lt;/IncludeAssets&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;SqliteExtension&quot; Version=&quot;1.0.0&quot; /&gt;
      &lt;PackageReference Include=&quot;SQLiteNetExtensionsCore&quot; Version=&quot;2.0.0&quot; /&gt;
      &lt;PackageReference Include=&quot;SQLitePCLRaw.lib.e_sqlite3.osx&quot; Version=&quot;1.1.14&quot; /&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  <p>I'm already searching for a solution for two days without luck.</p>