无法加载 DLL “ SQLite.Interop.dll”

来源:互联网 发布:春晓软件注册码 编辑:程序博客网 时间:2024/06/16 08:03


SQLite数据库进行操作时,提示:无法加载 DLLSQLite.Interop.dll”,找不到指定的模块;换了N个版本(包括32位、64位)还是不行


System.Data.SQLite版本是Setups for 32-bit Windows (.NET Framework 4.5),这个版本提供了两个exe文件:

sqlite-netFx45-setup-bundle-x86-2012-1.0.98.0.exe
sqlite-netFx45-setup-x86-2012-1.0.98.0.exe

带bundle的表示动态库是按混合模式编译的,在使用的时候只需要System.Data.SQLite.dll就可以了,而不带bundle的则是将非托管部分和托管部分分别编译,System.Data.SQLite.dll不能独立使用,还需要有SQLite.Interop.dll才能使用。


在SQLite的下载页面看到了下面这句话:

This setup package features the mixed-mode assembly and will install all the necessary runtime components and dependencies for the x86 version of the System.Data.SQLite 1.0.98.0 (3.8.11.1) package. The Visual C++ 2012 Update 4 runtime for x86 is included. The .NET Framework 4.5 is required.
This is the only setup package that is capable of installing the design-time components for Visual Studio 2012.

However, if you do not require the design-time components, please consider downloading the associated "Precompiled Binaries" instead.

Using Entity Framework 6 design-time support may require installing the Visual Studio 2012 "flavor" of the Entity Framework 6 Tools for Visual Studio 2012 & 2013.

上面的提示所述,使用SQLite时,需要有对应版本的.NET框架及VC++运行库支持。由于当前服务器是新装的系统,只安装了.Net的框架,所以按提示安装VC运行库解决问题。


附件:

VC运行库百度盘地址http://pan.baidu.com/s/1c2eIcIs

一般按照x86的库后,sqlite即可正常驱动。




0 0
原创粉丝点击