更新时间:2023-01-18 22:35:45
由于蒂姆·唐曾表示,如果使用的是实体框架6,你需要使用连接器/ NET 6.8.x.
你也应该加入到MySql.Data.Entity.EF6一个参考给你的项目。
As Tim Tang has stated, if you are using Entity Framework 6 for you need to use Connector/NET 6.8.x. You should also add a reference to the MySql.Data.Entity.EF6 to you project.
那么对于你的web.config文件中,这样的事情:
Then for your Web.config file, something like this:
<entityFramework>
<providers>
<provider invariantName="MySql.Data.MySqlClient"
type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient"></remove>
<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.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
看的这,获取更多详情。