I get the following error when I try to register a new user, using Identity 2.0 and the default MVC 5 application:
Invalid column name 'Email'.
Invalid column name 'EmailConfirmed'.
Invalid column name 'PhoneNumber'.
Invalid column name 'PhoneNumberConfirmed'.
Invalid column name 'TwoFactorEnabled'.
Invalid column name 'LockoutEndDateUtc'.
Invalid column name 'LockoutEnabled'.
Invalid column name 'AccessFailedCount'.
(repeats 2 more times, I have a total of 4 test users in AspNetUsers table.)
I have a small application I've just upgraded from MVC4/Identity 1.0 to MVC5/Identity 2.0, so I had the Identity 1.0 columns (UserName, PasswordHash, SecurityStamp, Discriminator) working.
- I'm was using a remotely hosted SQL2012 DB with the standard Identity 1.0 tables.
- I created a 'clean' project, registered a user and it ran fine on the localDB.
- I successfully ran 'add-migration initial' and 'update-database' on my remote database.
- I initially followed this official guide , and the code in step 5 wasn't being generated. I tried pasting it in by hand and ran "update-database -verbose" again. Seemed to complete successfully, but still get the error.
Appreciate any help!
migration and configuration.cs files
internal sealed class Configuration : DbMigrationsConfiguration<FactBanker.Models.ApplicationDbContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
}
protected override void Seed(FactBanker.Models.ApplicationDbContext context)
{
}
}
}
My V023 migration.cs file Both the Up() and Down() methods were empty.
public partial class V023 : DbMigration
{
public override void Up()
{
}
public override void Down()
{
}
}
add-migration
, did it create a migration script at all? can you share yourconfiguration.cs
and[whatever]_initial.cs
?AutomaticMigrationsEnabled = false
before running add-migration and update-database?