سؤال

I went to upgrade our ASP.NET Web Forms solution from Identity 1.x to Identity 2.0. I updated the three Identity 2.0 packages. I then went to work on implementing Password Reset, etc. I didn't realize I had to Update the Database. That migration failed because the tables were in the wrong context. We decided to start over. We deleted the tables but they are not getting recreated when I access the Login page. How do I get these tables regenerated or should I create them manually?

هل كانت مفيدة؟

المحلول

Try disabling the schema consistency. This is one time thing that needs to happen when you upgrade asp.net identity from version 1.0 to 2.0.

public ApplicationDbContext() : base("MyConnection", throwIfV1Schema:false)

Notice I added throwIfV1Schema:false as a second parameter. Compile it, try to log in so the DB gets updated, do the migrations if needed and then you can remove it.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top