Mysql 未知列';扩展1.鉴别器';在';其中第'条;

Mysql 未知列';扩展1.鉴别器';在';其中第'条;,mysql,asp.net,entity-framework-6,asp.net-identity,membership-provider,Mysql,Asp.net,Entity Framework 6,Asp.net Identity,Membership Provider,我正在使用Visual Studio 2013 web表单应用程序和MySql数据库来构建web表单应用程序,但我无法通过“成员资格和角色管理”。 我对会员资格使用了数据库优先的方法,当我尝试注册新用户时,我收到以下错误消息: Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more inf

我正在使用Visual Studio 2013 web表单应用程序和MySql数据库来构建web表单应用程序,但我无法通过“成员资格和角色管理”。 我对会员资格使用了数据库优先的方法,当我尝试注册新用户时,我收到以下错误消息:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: MySql.Data.MySqlClient.MySqlException: Unknown column   'Extent1.Discriminator' in 'where clause'

Source Error: 


Line 16:             var manager = new UserManager();
Line 17:             var user = new ApplicationUser() { UserName = UserName.Text };
Line 18:             IdentityResult result = manager.Create(user, Password.Text);
Line 19:             if (result.Succeeded)
Line 20:             {

Source File:     c:\WebsiteProjects\ASPNETWebProjects\RevenuePortal\RevenuePortal\Account\Register.aspx.cs  

奇怪的是,我在数据库的任何地方都没有“Extent1.Discriminator”列,无法理解这个令人沮丧的错误的原因。我将感谢您的帮助或建议。谢谢

Extent1是实体框架在构造底层sql语句时使用的表别名。该错误意味着EF未正确配置或误解了数据库结构


您需要分析它生成的底层查询,并确定为什么EF us3s不应该是一个字段。可能两个表之间的关系设置不正确。

谢谢。我允许ASP.net生成数据库表,解决了此问题。可能的错误包括缺少或命名错误的列/属性。您是否有关于哪些配置可能不正确的更多信息?作为对将来遇到此问题的任何人的补充说明:如果您让调试器中断查询所在的行正在执行,并在db上下文上检查your表的属性,您将看到EntityFramework生成的SQL。对我来说,这是不正确的,我可以很容易地指出我的一个列名是不正确的。