sqlce問題記錄

記錄一下使用sqlce進行嵌入式數據庫開發的過程中出現的一些問題。

1.異常信息:2016-01-04 15:04:58.9218750 Start 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複製到根目錄下,就可以了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章