簡體   English   中英

SQL Server Compact Edition和ADO.NET提供程序文件版本不匹配異常

[英]SQL Server Compact Edition and ADO.NET Provider File Version Mismatch Exception

我有一個基於Visual Studio 2013構建的Windows窗體項目,其中有一個.sdf文件。 我想使用應用程序來部署/發布數據庫,所以我遵循了Alizee Hayek的回答: https : //social.msdn.microsoft.com/Forums/windows/zh-CN/5042b5ba-26ca-4b36-b727-9ee59410925b/deploying - SQL服務器-CE-與-A-的ClickOnce應用程序?論壇= winformssetup

我做了他寫的所有東西,除了在我的表單中添加DataGridView。

當我使用ClickOnce發布我的應用並將其安裝在另一台筆記本電腦上時,出現此錯誤:

System.Data.SqlServerCe.SqCeException (0x8000405): Possible file version     
mismatch detected between ADO.NET Provider and native binaries of SQL Server 
Compact which could result in an incorrect functionality. This could be due to 
the presence of multiple instances of SQL Server Compact of different versions 
or due to wrong binaries with same name as SQL Server Compact binaries. Please 
install SQL Server Compact binaries of Matching version.

我無法理解哪里出了問題

您的System.DataSqlServerCe.dll版本與計算機上非托管dll文件的版本不匹配。 私有部署聽起來像是您的問題的解決方案。 您是否將Entity Framework或Ado.net/Linq用於sql? 最佳方法取決於此。

我通過運行在此頁面上找到的命令修復了該錯誤: https : //www.nuget.org/packages/EntityFramework.SqlServerCompact/4.1.8482.2

這將版本從6.1.0更改為4.1.xxxx,並解決了該問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM