2012-09-01 13 views
16

に対応するSQL Serverのコンパクトのネイティブコンポーネントを読み込むことができません、私は、エンティティフレームワークとSQL CE 3.5データベースを使用してthis articleに続くが、私は、この例外があります。私のプロジェクトで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.

すべてを詳細

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

KB記事974247を参照しましたか? –

答えて

2

私も同じ問題が発生しました。問題は私が次のコマンドを使用したことです インストールパッケージEFcodeFirst.SqlServerCompactはsqlCEを取得します。パッケージマネージャによってダウンロードされたバージョンは4.0であったと私のハードディスク上のバージョンの存在は3.5

だったのに対しては、次の場所http://www.microsoft.com/en-us/download/details.aspx?id=17876から最新バージョン4.0をダウンロードし、民間がインストールして、私はこのエラーを得た私の問題

28

解決しませんでしたのSqlServerCEの。私のプロジェクトでSystem.Data.SqlServerCe.dllへの参照がありましたが、SqlServerCEに必要な他のDLL(ネイティブコンポーネント)がありませんでした。 "ネイティブコンポーネント"は、SqlServerCEの "プライベート"フォルダのx86およびamd64サブフォルダにあります。それらがプロジェクトの出力フォルダにコピーされることを確認する必要があります。

+1

これらのフォルダはどこにありますか? – sports

+0

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

2

私にも同様の問題がありました。私は、コンパクトなフレームワークのSQLデータベースを開いたし、それは私に次のエラーました:記事を検索する場合、それは次のようLinkに私を導いた

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.

を。

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.

を、私はあなたが場所に以下のファイルやディレクトリ全体をコピーする必要があります、次のlink.

1

にサービスパックをダウンロードしてインストールすることで、それを解決して最終的には、以下の引用文は、何が悪かったのかを説明し.exeがサーバー上で実行されている場所。このファイルやフォルダは、ディレクトリCの中で最も可能性があります:\プログラムファイルプライベート

System.Data.SqlServerCe.dll 私は 全体のamd64フォルダ\ Microsoft SQL ServerのCompact Editionの\のV4.0 \(x86の) amd64フォルダから何が使用されているのかわからないが、アプリケーションの上でこれをコピーしてすぐに動作するようになった。また、System.Data.SqlServerCe.dllファイルをVisual StudioのReferencesフォルダの下でクリックして、プロパティタブの "Copy Local"をTrueに設定してから、アプリケーションをビルドするとファイルが作成されますリリースフォルダ。

関連する問題