1

Running MacOS Monterey version 12.1 IDE Jetbrains Rider version 2021.3.2

Using Microsoft EF Core version 6.0.1 on Macbook Pro M1. Trying to save to the database using EF Core but getting the following error message back.

It's an Azure Functions App that I am running locally and attempting to connect locally.

I've got Migrations working through EntityFramework but just cannot see to get the dbContext to connect to the DB when a function is called through the app.

'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, 0x0001): tried: 'libe_sqlite3' (no such file), '/usr/local/lib/libe_sqlite3' (no such file), '/usr/lib/libe_sqlite3' (no such file), '/Users/<name>/RiderProjects/API/project.API.Admin/bin/Debug/net6.0/libe_sqlite3' (no such file), '/usr/local/lib/libe_sqlite3' (no such file), '/usr/lib/libe_sqlite3' (no such file)'

I've tried installing 'SQLitePCLRaw.bundle_e_sqlite3 2.0.8-pre20220111224339' package but I still get the same problem.

Here is my CSPROJ file

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>
        <AzureFunctionsVersion>V4</AzureFunctionsVersion>
        <LangVersion>preview</LangVersion>
    </PropertyGroup>
    <ItemGroup>
        <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
        <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.0.0" />
        <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
        <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
    </ItemGroup>
    <ItemGroup>
        <None Update="host.json">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Update="local.settings.json">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
            <CopyToPublishDirectory>Never</CopyToPublishDirectory>
        </None>
    </ItemGroup>
    <ItemGroup>
      <ProjectReference Include="..\iAi.Services\iAi.Services.csproj" />
    </ItemGroup>
</Project>

Any help on how to get SQLite working on Mac using EntityFramework and .NET 6 is greatly appreciated.

1 Answer 1

2

Try to add Nuget package SQLitePCLRaw.bundle_e_sqlite3 2.0.7

Sign up to request clarification or add additional context in comments.

2 Comments

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
Already tried this. Didn't make any difference. Still end up with the same problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.