2012-09-01 42 views
16

En mi proyecto, utilizar la base de datos SQL CE 3.5 con el marco de la entidad y seguido this article pero tengo esta excepción:No se puede cargar los componentes nativos de SQL Server Compact correspondientes al proveedor de ADO.NET

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.

Todos detalles

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: 
+2

Entonces, ¿se refirió al artículo KB 974247? –

Respuesta

2

También he encontrado el mismo problema. el problema era que había usado el siguiente comando install-package EFcodeFirst.SqlServerCompact para obtener el sqlCE. la versión que se ha descargado por el gestor de paquetes fue de 4,0 y que en mi disco duro la versión actual fue de 3,5

descarga la última versión 4.0 de la siguiente ubicación http://www.microsoft.com/en-us/download/details.aspx?id=17876 se resolvió mi problema

28

Tengo este error con un privado instalar de SqlServerCE. Tenía una referencia a System.Data.SqlServerCe.dll en mi proyecto, pero me faltaban otros dlls (componentes nativos) necesarios para SqlServerCE. Los "componentes nativos" se encuentran en las subcarpetas x86 y amd64 de la carpeta "privada" de SqlServerCE. Debe asegurarse de que se copien en la carpeta de salida de su proyecto.

+1

¿dónde están estas carpetas? – sports

+0

C: \ Archivos de programa \ Microsoft SQL Server Compact Edition \ v4.0 \ Private – andy

2

Tuve un problema similar. Estaba abriendo una base de datos SQL marco compacto y me dio el siguiente error:

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.

Cuando se busca el artículo, que me llevó a la siguiente Link. La siguiente cita explica lo que salió mal:

Compact based applications generally program against the Compact ADO.NET provider (System.Data.SqlServerCe.dll). This provider in-turn communicates with the native Compact components. In order to avoid various inconsistencies, a Compact ADO.NET provider of a certain version can talk only to the Compact native components of the same version.

Al final me lo resolvió mediante la descarga e instalación del Service Pack en la siguiente link.

1

Tendrá que copiar el siguiente archivo y directorio completo a la ubicación donde su .exe se está ejecutando en su servidor. Este archivo y la carpeta son más probables en el directorio C: \ Archivos de programa (x86) \ Microsoft SQL Server Compact Edition \ V4.0 \ Private

System.Data.SqlServerCe.dll toda la carpeta amd64 estoy No estoy seguro de qué se usa desde la carpeta amd64, pero en cuanto copié esto sobre mi aplicación, comencé a trabajar. También puede obtener su archivo System.Data.SqlServerCe.dll haciendo clic en Visual Studio en la carpeta References y luego en la pestaña de propiedades "Copy Local" en True y luego, cuando construya la aplicación, ese archivo estará en su lanzar la carpeta.

Cuestiones relacionadas