2013-10-31 30 views
0

我嘗試我的實體框架連接的MySQL數據庫,但是當我連這個錯誤發生錯誤提供商實體框架的MySQL

沒有實體框架提供發現用於固定名稱「的ADO.NET提供MySql.Data .MySqlClient」。確保提供程序在應用程序配置文件的'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> 
+0

您是否安裝了MySQL Connector for .NET? – Andrew

+0

是的,我安裝了mySQL連接器 –

+0

在包管理器控制檯中,嘗試運行這個命令'Install-Package EntityFramework -Pre' – Andrew

回答

0

副本MySql.Data.Entity.EF5.dll與MySql.Data.Entity.EF6.dll一起到bin目錄。