sqlce问题记录

来源:互联网 发布:药渡数据 编辑:程序博客网 时间:2024/05/29 15:05

记录一下使用sqlce进行嵌入式数据库开发的过程中出现的一些问题。

1.异常信息:2016-01-04 15:04:58.9218750Start Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. 系统找不到指定的文件


确保依赖都要有,amd64,x64,x86几个文件夹里的文件全部都要有

2.异常信息:Start Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8876. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.

在 ADO.NET 提供程序与 SQL Server Compact 的本机二进制文件之间检测到文件版本可能不匹配,这会导致功能不正确。这可能是由于存在不同版本的 SQL Server Compact 的多个实例,或由于存在与 SQL Server Compact 二进制文件同名的错误二进制文件。请安装匹配版本的 SQL Server Compact 二进制文件。

解决:确保使用的sqlce是同一个版本

3程序直接崩溃的异常:

a.“应用程序无法启动,因为应用程序的并行配置不正确。请参阅应用程序事件日志,或使用命令行sxstrace.exe工具”

b."..\x86\sqlceme40.dll"的激活上下文生成失败。 找不到从属程序集 Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.30729.4148"。 请使用 sxstrace.exe 进行详细诊断

错误应用程序名称: test.exe,版本: 5.0.20000.54638,时间戳: 0x58a4276f
错误模块名称: KERNELBASE.dll,版本: 6.1.7600.16385,时间戳: 0x4a5bdbdf
异常代码: 0xe0434352
错误偏移量: 0x0000b727
错误进程 ID: 0x8d4
错误应用程序启动时间: 0x01d28d859a5ae514
错误应用程序路径: D:\test\test.exe
错误模块路径: C:\Windows\syswow64\KERNELBASE.dll
报告 ID: f7f806c1-f978-11e6-aa81-000c297dc319

解决:此时一般也是确实依赖项,首先visual c++ 支持库要装好,若装好还是解决不了,把x86\Microsoft.VC90.CRT\msvcr90.dll复制到根目录下,就可以了

0 0
原创粉丝点击