natemcmaster / DotNetCorePlugins

.NET Core library for dynamically loading code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DllNotFoundException: Unable to load DLL 'e_sqlite3' or one of its dependencies

HamedFathi opened this issue · comments

Describe the bug
I am using Microsoft.Data.Sqlite inside one of my plugins, below functionality.

private string[] GetSQLiteTables(string connStr)
{
    var tables = new List<string>();

    using var connection = new SqliteConnection(connStr);
    connection.Open();
    var command = connection.CreateCommand();
    command.CommandText = @"SELECT name FROM sqlite_master WHERE type ='table' AND name NOT LIKE 'sqlite_%' ORDER BY name;";
    using var reader = command.ExecuteReader();
    while (reader.Read())
    {
        tables.Add(reader.GetString(0));
    }

    return tables.ToArray();
}

but when I am loading the plugin I get the following error:

DllNotFoundException: Unable to load DLL 'e_sqlite3' or one of its dependencies: The specified module could not be found. (0x8007007E)

To Reproduce

The project and code is here

Expected behavior
I think the loader should load the DLL without a problem. Even I copied SQLitePCLRaw.provider.e_sqlite3.dll to the plugin folder but nothing happened.

Screenshots
image

Possibly a duplicate of #84. Can you read that thread? If it's the same issue, this issue isn't something we can fix here. You'll have to ask for help from Microsoft or use workarounds shared in that thread.