简体   繁体   English

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

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

I have a windows forms project built on visual studio 2013 in which I have a .sdf file. 我有一个基于Visual Studio 2013构建的Windows窗体项目,其中有一个.sdf文件。 I wanted to deploy/publish my database with my application so I followed Alizee Hayek's answer on: https://social.msdn.microsoft.com/Forums/windows/en-US/5042b5ba-26ca-4b36-b727-9ee59410925b/deploying-sql-server-ce-with-a-clickonce-application?forum=winformssetup 我想使用应用程序来部署/发布数据库,所以我遵循了Alizee Hayek的回答: https : //social.msdn.microsoft.com/Forums/windows/zh-CN/5042b5ba-26ca-4b36-b727-9ee59410925b/deploying - SQL服务器-CE-与-A-的ClickOnce应用程序?论坛= winformssetup

I did everything he wrote except for adding DataGridView in my form. 我做了他写的所有东西,除了在我的表单中添加DataGridView。

When i published my app using ClickOnce and installed it on another laptop, I got this error: 当我使用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.

I am not being able to understand what is wrong 我无法理解哪里出了问题

Your version of System.DataSqlServerCe.dll does not match the version of the unmanaged dll files on the machine. 您的System.DataSqlServerCe.dll版本与计算机上非托管dll文件的版本不匹配。 Private deployment sounds like a solution to your problem. 私有部署听起来像是您的问题的解决方案。 Do you use Entity Framework or Ado.net/Linq to sql? 您是否将Entity Framework或Ado.net/Linq用于sql? The best approach depends on this. 最佳方法取决于此。

I fixed this error by running the command found on this page: https://www.nuget.org/packages/EntityFramework.SqlServerCompact/4.1.8482.2 我通过运行在此页面上找到的命令修复了该错误: https : //www.nuget.org/packages/EntityFramework.SqlServerCompact/4.1.8482.2

This changed the version from 6.1.0 to 4.1.xxxx and solved the issue. 这将版本从6.1.0更改为4.1.xxxx,并解决了该问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载与 ADO.NET 提供程序对应的 SQL Server Compact 的本机组件 - Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider 从ADO.NET确定SQL Server的版本 - Determine version of SQL Server from ADO.NET 在ReportViewer .Net 4.0中使用Sql Server Compact Edition数据库文件 - Use Sql Server Compact Edition Database File in ReportViewer .Net 4.0 从ado.net应用程序(MS SQL提供程序)发送到服务器的什么sql语句 - what sql statement sent to server from ado.net application (MS SQL provider) ADO.NET SQL Server性能瓶颈 - ADO.NET SQL Server Performance bottleneck 实体Framewok代码首先使用本地SQL Server CE DLL“找不到ADO.NET提供程序” - Entity Framewok Code First “ADO.NET provider not found” with local SQL Server CE DLL's 如何使用应用程序部署.Net Compact Framework和SQL Server Compact Edition - How to deploy the .Net Compact Framework and SQL Server Compact Edition with the Application 自定义ADO.NET提供程序来拦截和修改sql查询 - Custom ADO.NET provider to intercept and modify sql queries SQL Server - 只有通过 ADO.NET 执行存储过程时才会出现“无效的列名”异常 - SQL Server - 'Invalid column name' exception only when executing stored procedure through ADO.NET SQL Server 2005上的ADO.NET 2.0事务是否会在异常时自动回滚? - Is an ADO.NET 2.0 Transaction on SQL Server 2005 automatically rolled back on exception?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM