Answer the question
In order to leave comments, you need to log in
dll missing error when using sqlite-net in c#, how to fix?
Installed using NuGet package manager System.Data.SQLite and sqlite-net, but when creating connection using sqlite-net:
SQLiteConnection conn = new SQLiteConnection("dbname.db", false);
An unhandled exception of type 'System.DllNotFoundException' occurred in SQLiteTest.exedll sqlite3.dll added to the project, tried different bit depths, nothing changes. What could be the reason? In which direction to look?
Additional information: Cannot load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Cannot load DLL \"sqlite3\": This operation is only valid in the context of an application container. (Exception from HRESULT: 0x8007109A)
Answer the question
In order to leave comments, you need to log in
Make sure to install this https://www.nuget.org/packages/System.Data.SQLite/ or this https://www.nuget.org/packages/System.Data.SQLite.Core/ package. sqlite-net is of no use to you, if these are already installed, try to remove it, it may be causing a conflict. A properly installed System.Data.SQLite package should be self-contained in terms of assembly (should copy the necessary files itself).
"added to the project" - I'm afraid EXE knows absolutely nothing about the project. Try to put the corresponding DLL in the directory from where the EXE is launched.
check that the working directory is correctly specified, probably the application "looks" in the wrong folder in which the dll is located
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question