本文介绍了MySQL和asp.net身份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不能够得到asp.net mvc5身份使用MySQL。这里是web.config中的部分.Could这是怎么一回事,因为EF6的不mvc5工作?
<&System.Data这GT;
< DbProviderFactories>
<清除NAME =MySQL的数据提供程序/> <添加名称=MySQL的数据提供程序
不变=MySql.Data.MySqlClient
说明=用于MySQL的.NET Framework数据提供程序
键入=MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data,文化=中性公钥= c5687fc88969c44d/>
< / DbProviderFactories>
< /system.data>的EntityFramework>
< defaultConnectionFactory TYPE =MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data/>
<供应商>
<供应商invariantName =MySql.Data.MySqlClient
键入=MySql.Data.MySqlClient.MySqlProviderServices,MySql.Data.Entity/>
< /供应商>
< /&的EntityFramework GT;
该错误是:
解决方案
That because you are referencing EF 6, and MySQL Connector still does not support EF6. You can either downgrade to EF 5 or get the MySQL Connector Alpha.
Do this (KEEP A COPY OF WHAT YOU JUST PASTED):
- Erase all references to EF6
- Get EF 5 from Nuget (open a NuGet console and type Install-Package EntityFramework -Version 5.0.0 )
- Regenerate your Entities
- Make sure you get the
<DbProviderFactories>
and<providers>
sections just like you have.
这篇关于MySQL和asp.net身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!