首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >无法加载与ADO.NET提供程序对应的SQL Server Compact的本机组件

无法加载与ADO.NET提供程序对应的SQL Server Compact的本机组件
EN

Stack Overflow用户
提问于 2012-09-01 17:23:01
回答 4查看 47.1K关注 0票数 23

在我的项目中,我使用带有实体框架的SQLCE3.5数据库,并遵循this article,但我有以下例外:

无法加载与8080版的ADO.NET提供程序相对应的SQL Server Compact的本机组件。安装正确版本的SQL Server Compact。有关更多详细信息,请参阅知识库文章974247。

所有详细信息

代码语言:javascript
复制
System.Data.SqlServerCe.SqlCeException was unhandled
  Message=Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8080. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.
  Source=""
  HResult=-1
  NativeError=-1
  StackTrace:
       at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
       at System.Data.SqlServerCe.SqlCeConnection..ctor()
       at System.Data.SqlServerCe.SqlCeProviderFactory.CreateConnection()
       at System.Data.EntityClient.EntityConnection.GetStoreConnection(DbProviderFactory factory)
       at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
       at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
       at DAL.OimDBEntities..ctor()
       at DAL.OimRepository..ctor()
       at Microsoft.Rtc.Collaboration.Sample.SubscribePresenceView.UCMASampleSubscribePresenceView.Subscribe()
       at Microsoft.Rtc.Collaboration.Sample.SubscribePresenceView.UCMASampleSubscribePresenceView.Run()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.DllNotFoundException
       Message=Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
       Source=System.Data.SqlServerCe
       TypeName=""
       StackTrace:
            at System.Data.SqlServerCe.NativeMethods.GetSqlCeVersionInfo(IntPtr& pwszVersion)
            at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath, Int32 moduleVersion)
            at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
       InnerException: 
EN

回答 4

Stack Overflow用户

发布于 2013-06-13 12:15:17

我在私有安装SqlServerCE时遇到了这个错误。我在我的项目中引用了System.Data.SqlServerCe.dll,但我缺少SqlServerCE所需的其他dlls (本机组件)。“本机组件”位于SqlServerCE的“私有”文件夹的x86和amd64子文件夹中。您需要确保将它们复制到项目的输出文件夹中。

票数 37
EN

Stack Overflow用户

发布于 2012-12-12 16:11:29

我也遇到过同样的问题。问题是我使用了下面的命令install-package EFcodeFirst.SqlServerCompact来获取sqlCE。包管理器下载的版本是4.0,而在我的硬盘上,当前的版本是3.5

从以下位置下载最新的4.0版本http://www.microsoft.com/en-us/download/details.aspx?id=17876确实解决了我的问题

编辑:上面的链接现在返回404。这是下载文件的正确位置:https://www.microsoft.com/en-us/download/details.aspx?id=30709

票数 3
EN

Stack Overflow用户

发布于 2014-12-01 19:13:41

我也遇到过类似的问题。我打开一个紧凑的框架sql数据库,它给了我以下错误:

无法加载与8080版的ADO.NET提供程序相对应的SQL Server Compact的本机组件。安装正确版本的SQL Server Compact。有关更多详细信息,请参阅知识库文章974247。

在查找这篇文章时,它将我带到了以下Link。下面的引述解释了哪里出了问题:

基于

压缩版的应用程序通常针对紧凑型ADO.NET提供程序(System.Data.SqlServerCe.dll)进行编程。该提供程序依次与本机Compact组件进行通信。为了避免各种不一致,某个版本的压缩ADO.NET提供程序只能与相同版本的压缩原生组件通信。

最后,我通过在下面的link.中下载并安装service pack来解决这个问题

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12226530

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档