0

The Issue

I'm trying to seed some users in my project (my code is identical to this), however when I inspect my AspNetUsers table, no rows have been created.

Why I am certain I've not messed up

I have enabled migrations, updated my database, confirmed my password and other attributes don't violate any constraints, followed this online tutorial on Identity to the T &, as posted above, confirmed my code against an existing StackOverflow post.

Furthermore, the update-database command successfully created new properties for my ApplicationUser in AspNetUsers table, it just did not create my users (despite Package Manager Console confirming the seed method ran.

I'm getting no indication of any errors, so I'd appreciate any guidance on how to begin debugging this :)

Community
  • 1
  • 1
n4akes
  • 63
  • 4
  • Here is a similar thread from a user, even following the same Scott Allen tutorial. I also followed and implemented the tutorial without issues. I would suspect constraints though you mention you checked those. Maybe post your PasswordValidator and UserValidator code. Also the referenced seed code is not populating all identity columns like my working code does so make sure you supply everything like email. http://stackoverflow.com/questions/25354751/no-users-have-been-created-during-seed-method-using-usermanager-in-asp-net-mvc – Steve Greene Feb 11 '16 at 15:42
  • 1
    You could also try seeding from within your code, like the Index action of the home controller. Use this command: var result = manager.Create(user, "ChangeItAsap!"); which will identify if there is an issue adding the user. – Steve Greene Feb 11 '16 at 15:46

0 Answers0