You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Library e_sqlite3 not found" on .Net Framework 4.7.2 (SDK-style project) #33472
In Program.cs try to create a connection via using (var connection = new SqliteConnection("Data Source=test.sqlite")) {}
Launch application to get an error (despite of D:\tests\ConsoleApp1\ConsoleApp1\bin\Debug\net472\e_sqlite3.dll present):
Library e_sqlite3 not found
plat: win
suffix: DLL
possibilities (2):
1) D:\tests\ConsoleApp1\ConsoleApp1\bin\Debug\net472\runtimes\win-x64\native\e_sqlite3.dll
2) D:\tests\ConsoleApp1\ConsoleApp1\bin\Debug\net472\e_sqlite3.dll
win TryLoad: D:\tests\ConsoleApp1\ConsoleApp1\bin\Debug\net472\runtimes\win-x64\native\e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module was not found
at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action1 log, IntPtr& h) win TryLoad: D:\tests\ConsoleApp1\ConsoleApp1\bin\Debug\net472\e_sqlite3.dll thrown: System.ComponentModel.Win32Exception (0x80004005): %1 is not a Win32 application at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action1 log, IntPtr& h)
NOT FOUND
P. S. Issue reproduces with library versions 8.0.x, 7.0.x, 6.0.x and 3.1.32. Same code is working correctly with versions <= 3.1.31 and any of 5.0.x branch.
Include stack traces
The initializer of type "Microsoft.Data.Sqlite.SqliteConnection" gave an exception.
at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)
at ConsoleApp1.Program.Main(String[] args) в D:\tests\ConsoleApp1\ConsoleApp1\Program.cs:строка 12
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
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.SqliteConnection..cctor()
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()
Include version information
Microsoft.Data.Sqlite version: 8.0.x, 7.0.x, 6.0.x and 3.1.32
Target framework: .NET Framework 4.7.2
Operating system: Windows 10 22H2 Pro 64bit
Activity
cincuranet commentedon Apr 8, 2024
For .NET 4.7.2 you need to add into your csproj
<PlatformTarget>x64</PlatformTarget>.