2012-09-01 10 views
16

Nel mio progetto, io uso 3,5 database SQL CE con Entity Framework e seguito this article ma ho questa eccezione:Impossibile caricare i componenti nativi di SQL Server Compact corrispondenti al provider 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.

Tutto dettagli

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

Quindi, si riferiva all'articolo KB 974247? –

risposta

2

Ho anche riscontrato lo stesso problema. il problema era che avevo usato il seguente comando pacchetto di installazione EFcodeFirst.SqlServerCompact per ottenere lo sqlCE. la versione che è stato scaricato dal gestore di pacchetti è di 4,0 e che sul mio disco rigido la versione attuale è stata del 3,5

scaricare l'ultima versione 4.0 dal seguente percorso http://www.microsoft.com/en-us/download/details.aspx?id=17876 ha risolto il mio problema

28

ho ottenuto questo errore con un privato installazione di SqlServerCE. Ho avuto un riferimento a System.Data.SqlServerCe.dll nel mio progetto, ma mi mancavano altri dll (componenti nativi) necessari per SqlServerCE. I "componenti nativi" sono nelle sottocartelle x86 e amd64 della cartella "privata" di SqlServerCE. Devi assicurarti che vengano copiati nella cartella di output del tuo progetto.

+1

dove sono queste cartelle? – sports

+0

C: \ Programmi \ Microsoft SQL Server Compact Edition \ v4.0 \ Private – andy

2

Ho avuto un problema simile. Stavo aprendo un database SQL Compact quadro e mi ha dato il seguente errore:

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.

Quando si cerca l'articolo, mi ha portato al seguente Link. La seguente citazione spiega cosa è andato storto:

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.

Alla fine ho risolto scaricando e installando il Service Pack nel seguente link.

1

Sarà necessario copiare il seguente file e tutta la directory alla posizione dove il tuo .exe è in esecuzione sul tuo server. Questo file e la cartella sono più probabili nella directory C: \ Program Files (x86) di Microsoft SQL Server Compact Edition \ V4.0 \ privata

System.Data.SqlServerCe.dll L'intera cartella amd64 io sono \ non sono sicuro di ciò che viene utilizzato dalla cartella amd64, ma non appena ho copiato questo, la mia applicazione ha iniziato a funzionare. È anche possibile ottenere il file System.Data.SqlServerCe.dll facendo clic su di esso in Visual Studio nella cartella Riferimenti e quindi nella scheda Proprietà impostando "Copia locale" su True e quindi quando si crea l'app il file sarà nel cartella di rilascio.

Problemi correlati