0

エンティティ フレームワークを MySQL データベースに接続しようとしましたが、接続するとこのエラーが発生します

不変名 'MySql.Data.MySqlClient' を持つ ADO.NET プロバイダーの Entity Framework プロバイダーが見つかりません。プロバイダーがアプリケーション構成ファイルの「entityFramework」セクションに登録されていることを確認してください。詳細については、http: //go.microsoft.com/fwlink/?LinkId=260882を参照してください。

これは、私のクラス ライブラリ ウィット エンティティの appConfig です。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
 <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="portallentesContext" connectionString="server=******;User Id=******;password=*********;Persist Security Info=True;database=portallentes"
  providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<system.data>
<DbProviderFactories>
  <remove invariant="MySql.Data.MySqlClient" />
  <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.4.0" />
</DbProviderFactories>
</system.data>

<entityFramework>
<providers>
  <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.4.0" >
  </provider>
</providers>
</entityFramework>
</configuration>
4

2 に答える 2

0

MySql.Data.Entity.EF5.dll と MySql.Data.Entity.EF6.dll をまとめて bin ディレクトリにコピーします。

于 2014-02-24T23:23:06.897 に答える