加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Sqlite平台类型导致的错误情况

发布时间:2020-12-12 19:40:51 所属栏目:百科 来源:网络整理
导读:{"未能加载文件或程序集“System.Data.SQLite,Version=1.0.97.0,Culture=neutral,PublicKeyToken=db937bc2d44ff139”或它的某一个依赖项。试图加载格式不正确的程序。"} 出现情况: 原来程序编译时用的是vs2008在win 7 32系统环境下编译的。 把程序源码copy

{"未能加载文件或程序集“System.Data.SQLite,Version=1.0.97.0,Culture=neutral,PublicKeyToken=db937bc2d44ff139”或它的某一个依赖项。试图加载格式不正确的程序。"}

出现情况:

原来程序编译时用的是vs2008在win 7 32系统环境下编译的。

把程序源码copy到win 8 64位 在vs2013下调试时出现如下错误。

未处理System.BadImageFormatException
Message=未能加载文件或程序集“System.Data.SQLite,PublicKeyToken=db937bc2d44ff139”或它的某一个依赖项。试图加载格式不正确的程序。
Source=Model
FileName=System.Data.SQLite,PublicKeyToken=db937bc2d44ff139
FusionLog==== 预绑定状态信息 ===
日志: DisplayName = System.Data.SQLite,PublicKeyToken=db937bc2d44ff139
(Fully-specified)
日志: 初始 PrivatePath = NULL
调用程序集: Model,Version=1.0.0.0,PublicKeyToken=null。
===
日志: 此绑定从 default 加载上下文开始。
日志: 正在使用应用程序配置文件: C:Users文件路径binDebug项目名称.vshost.exe.Config
日志: 使用 C:WindowsMicrosoft.NETFramework64v2.0.50727configmachine.config 的计算机配置文件。
日志: 策略后引用: System.Data.SQLite,PublicKeyToken=db937bc2d44ff139
日志: 试图下载新的 URL
file:///C:/文件路径/bin/Debug/System.Data.SQLite.DLL
错误: 未能完成程序集的安装(hr = 0x8007000b)。探测终止。

StackTrace:
在 Model.SysOperator.GetSysOperatorByCondition(String condition)
在 Model.SysOperator.UserLogin(String EmpAcct,String EmpPwd,String StoreId) 位置 c:UsersModelSysOperator.cs:行号 104
在 TradingSystem.LoginForm.UserLogin(String username,String password,String storeId,HtmlElement txtUserName,HtmlElement txtPwd) 位置 c:LoginForm.cs:行号 82
在 LoginForm.<>c__DisplayClass1.<btnLogin_Click>b__0() 位置 c:LoginForm.cs:行号 73
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback,Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:

原因:

SQLite下载的平台类型不对!!调试出错用的是64位WIN8系统,而SQLite下载的是X8632位的!?

解决方案:

在VS2013中的“项目“里的“属性”里的“生成”-》目标平台设置为x86

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读