SQLite 解决:Could not load file or assembly 'System.Data.SQLite ... 试图加载格式不正确的程序/or one of its dependencies. 找不到指定的模块。

 Could not load file or assembly ‘System.Data.SQLite.dll’ or one of its dependencies. 找不到指定的模块。

错误提示如下:

Could not load file or assembly ‘System.Data.SQLite,Version=1.0.66.0,Culture=neutral,PublicKeyToken=db937bc2d44ff139′ or one of its dependencies. 试图加载格式不正确的程序


原因:

System.Data.SQLite分X64和X86版本。

一般来说,在64位系统上就应该使用X64版本的,但是这样一来开发工作似乎就繁琐了许多

如果不区分,就会出现如上的问题。

解决步骤1:[环境:VS2012]

为了简便,一律使用X86版的SQLite开发,省了许多麻烦!然后……

依次选择:【项目】–>【属性】,【生成】里面的【目标平台】设置由【Any CPU】成【x86】

如图:

《SQLite 解决:Could not load file or assembly 'System.Data.SQLite ... 试图加载格式不正确的程序/or one of its dependencies. 找不到指定的模块。》


解决步骤2:

System.Data.SQLite.dll is a mixed assembly, i.e. it contains both managed code and native code.,

需要安装Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)




本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/p/5335996.html,如需转载请自行联系原作者

点赞