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

问题描述 投票:0回答:3

我有一个基于 Visual Studio 2013 构建的 Windows 窗体项目,其中有一个 .sdf 文件。我想用我的应用程序部署/发布我的数据库,所以我按照 Alizee Hayek 的回答:https://social.msdn.microsoft.com/Forums/windows/en-US/5042b5ba-26ca-4b36-b727-9ee59410925b/正在部署-sql-server-ce-with-a-clickonce-application?forum=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.

我无法理解出了什么问题

c# winforms sql-server-ce
3个回答
1
投票

您的 System.DataSqlServerCe.dll 版本与计算机上非托管 dll 文件的版本不匹配。私人部署听起来像是解决您问题的方法。您使用实体框架还是 Ado.net/Linq to sql?最好的方法取决于此。


0
投票

我通过运行此页面上的命令修复了此错误:https://www.nuget.org/packages/EntityFramework.SqlServerCompact/4.1.8482.2

这将版本从 6.1.0 更改为 4.1.xxxx 并解决了问题。


0
投票

我在开发机器中安装了相应的包(在我的例子中是SSCERuntime_x64-ITA.exe),因为已经安装的(旧的)sql server在GAC上注册了旧版本的dll。

© www.soinside.com 2019 - 2024. All rights reserved.