无法加载DLL SQLite.Interop.dll找不到指定的模块

数据库 码拜 10年前 (2014-11-09) 3779次浏览 0个评论

在SQLite官方下载了System.Data.SQLite,编写如下测试代码:

using (SQLiteConnection conn = new SQLiteConnection(@”Data Source=F:\my.db;Pooling=true;FailIfMissing=false”))
{
using (SQLiteDataAdapter adapter = new SQLiteDataAdapter(“select id,total from table1”, conn))
{
DataTable table1 = new DataTable();
adapter.Fill(table1);MessageBox.Show(table1.Rows[0][“total”].ToString());
}
}

运行出错,在new SQLiteConnection处提示:

引用内容
无法加载 DLL“ SQLite.Interop .dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。

无法加载DLL SQLite.Interop.dll找不到指定的模块

解决方法

我下载的System.Data.SQLite版本是Precompiled Binaries for 32-bit Windows (.NET Framework 3.5 SP1),这个版本提供了两个zip包:

①.sqlite-netFx35-binary-bundle-Win32-2008-1.0.79.0.zip

引用内容
This binary package features the mixed-mode assembly and contains all the binaries for the x86 version of the System.Data.SQLite 1.0.79.0 (3.7.10) package. The Visual C++ 2008 SP1 runtime for x86 and the .NET Framework 3.5 SP1 are required.

②.sqlite-netFx35-binary-Win32-2008-1.0.79.0.zip

引用内容
This binary package contains all the binaries for the x86 version of the System.Data.SQLite 1.0.79.0 (3.7.10) package. The Visual C++ 2008 SP1 runtime for x86 and the .NET Framework 3.5 SP1 are required.

我在项目引用的是第②个zip中的System.Data.SQLite.dll,运行出错,改为引用第①个zip中的System.Data.SQLite.dll即可正常运行。


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明无法加载DLL SQLite.Interop.dll找不到指定的模块
喜欢 (1)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!