0 votes

I'm trying to use Sqlite with C#. I'm getting a DllNotFound exception when running the project from the editor:

System.DllNotFoundException: e_sqlite3 assembly:<unknown assembly> type:<unknown type> member:(null)

As you can see, it's failing to find e_sqlite3.dll, which has multiple versions for different platforms. In the Debug build output directory, all the other DLLs I'm using live in one place, but e_sqlite3.dll is split into different versions per architecture - it looks a bit like this:

- bin
    - Debug
        - MainGameProject.dll
        - Microsoft.Data.Sqlite.dll
        - ...a few other dependencies...
        - runtimes
            - win-arm/native
                - e_sqlite3.dll
            - win-x64/native
                - e_sqlite3.dll
            - win-x86/native
                - e_sqlite3.dll

If I copy thee_sqlite3.dll for my system (win-x64) and paste it into the Debug directory, all is well, but I feel like I'm probably doing something wrong in my project file or somewhere else in order to cause this.

For reference, my project file:

<Project Sdk="Godot.NET.Sdk/3.3.0">
  <PropertyGroup>
    <ProjectGuid>{209CA65A-C9E1-4DC2-ACC5-30EEFE8E6010}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>DeeElsie</RootNamespace>
    <AssemblyName>DeeElsie</AssemblyName>
    <TargetFramework>net472</TargetFramework>
    <!--The following properties were overriden during migration to prevent errors.
    Enabling them may require other manual changes to the project and its files.-->
    <Deterministic>false</Deterministic>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.1" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="System" />
  </ItemGroup>
</Project>

Does anyone have any idea what I might need to tweak to get Godot to locate the relevant version of the dll itself?

Godot version 3.4
in Engine by (12 points)

1 Answer

0 votes

You did a nuget restore or dotnet restore ?

Godot works with at least dotnet core 3.1 .
Newer dotnet Versions have the "dotnet cli". Just open a terminal and use the command. Dotnet will then download the package for SQL Lite from the online store.

https://docs.microsoft.com/en-us/dotnet/core/tools/

by (710 points)

Yes, when I first installed the package it was downloaded - that's how the dll and associated folder structure in the question is able to get there in the first place. I also have run dotnet restore a few times to ensure there's no issues with that - definitely doesn't seem to be an issue related to nuget as far as I can tell.

Thanks for the response all the same, much appreciated :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.