SQLite部署-无法加载 DLL“SQLite.Interop.dll”: 找不到指定的模块

 近期刚使用SQLite,主要引用的是System.Data.SQLite.dll这个dll,在部署到测试环境时报无法加载 DLL“SQLite.Interop.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。

  

  后上官网查了下,sqlite-netFx40-binary-Win32-2010-1.0.94.0.zip 这个包中的System.Data.SQLite.dll是需用到SQLite.Interop.dll,但是这个dll不是.net版本的无法直接引用,只能拷贝到文件执行目录,不过时好时坏,无法完全避免报错。

  只能再次搜索,发现sqlite-netFx40-binary-bundle-Win32-2010-1.0.94.0.zip 这个包中的System.Data.SQLite.dll是不需要SQLite.Interop.dll,果断替换,本机运行无报错,上传到测试环境,结果又悲催了,软件启动就奔溃退出,这是闹那样?

  研究了下官网的描述: 

This binary package features the mixed-mode assembly and contains all the binaries for the x86 version of the System.Data.SQLite 1.0.94.0 (3.8.6) package. The Visual C++ 2010 SP1 runtime for x86 and the .NET Framework 4.0 are required

   比对了下本机和测试环境,还真缺“Visual C++ 2010 SP1 runtime for x86”这个补丁,上微软官方找到下载地址,下载安装到测试环境,终于不再报错了。

原文地址:https://www.cnblogs.com/waw/p/5798061.html