-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin user and role in the seed() of ApplicationDbInitializer is not executed #4
Comments
What version of ASP.NET and Identity are you using? This post is a little long in the tooth now, and was written against Identity 2.0 before it was included as a template in VS. THings may have changed a little since then. |
Thank you for your quick response. I am using Asp.net version: 4.5 Basically I just download it as zip from Github. Then And then run the app. It works good and I can register users. But the DB tables were not created until I registered the first new user (Tables were not created when the app starts first). By the way, this one created by John was just working fine with seeding the admin data: I tried to compare the the files but I did not find where the key is. You help or directions are appreciated very much. Thanks, |
Ooops. Didn;t mean to close that! Btw, I am John. Do me a favor, and see what happens if you change the password for the users to include a non-alphanumeric character - like "Password1!" I seem to recall they may have tightened up the default password requirements. If you are using Identity 2.2.1 this may be what is preventing the user from being created? I've been away from this project for a while, but I'll try to take a lok in the next few days. |
Hi John, It is working for me now. Your package has no issues at all and is working on the most recent Identity version just well. I think I found why I had this issue. There is a concept about at what point the application db seed() code got executed. When I launched the app, http://localhost through IIS or http://localhost:6208 through VS, the DB tables were not created. Navigating the default menu items (Application Name, Home, Contact, Register, Login) does NOT trigger the seed() to be executed either. It only happens when I click login and use admin user email and password set in the seed() code, the DB tables are created and login is successful. I think 'code triggered when the app/project starts' was a little confusing to me. I want to say thank you again for your packages and the great series of articles on your website: And thank you for your time and help offer. Regards, |
Application runs well but did not see the seeded Admin 'User' and 'Role', please help.
Thanks,
Jwndev
The text was updated successfully, but these errors were encountered: