1

Since updating my solution to use ASPNET Identity instead of the old membership, the migrate.exe commando to update database schema stopped working. The only major change is that my Context now inherits from a IdentityDbContext, when before it inherited from a DbContext.

Everything works fine running update-database on package manager console, but using migrate.exe on the command line doesn't work anymore. I get the error:

System.Data.Entity.Migrations.Infrastructure.MigrationsException: No migrations configuration type was found in the assembly 'SampleProject.Repository.EF'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).

I have a Configuration.cs file for the migrations, as always had and when running the "enable-migrations" suggested I get a message saying that migration are already enabled for the project.

Does anyone knows what the problem might be?

Thanks

3
  • Try adding switches to your command that identify where the context is. stackoverflow.com/questions/18126711/… Commented Dec 14, 2015 at 20:42
  • Doesn't seem to be related at all. The context and migrations in my case sit in the same project. It always worked fine and migrations work if running "update-database" through package manager console, so I have a migrations folder and a configuration file. The problem is when running "migrate.exe" on the command line. Commented Dec 15, 2015 at 8:45
  • You might try resetting migrations if you are in a position to do so (delete folder and db table, re-enable, add, update). stackoverflow.com/questions/10718648/… Commented Dec 15, 2015 at 14:21

1 Answer 1

0

Just a quick update on the solution. It was DLL version conflict when running migrate.exe. I was using the output from my web project (which also contained DLL for the EF project). I updated it in order to use the bin content of my EF project and it worked just fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.