繁体   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