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

joaoruimartins
  • 537
  • 4
  • 14
  • Try adding switches to your command that identify where the context is. http://stackoverflow.com/questions/18126711/enable-migrations-with-context-in-separate-assembly – Steve Greene Dec 14 '15 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. – joaoruimartins Dec 15 '15 at 08:45
  • You might try resetting migrations if you are in a position to do so (delete folder and db table, re-enable, add, update). http://stackoverflow.com/questions/10718648/how-to-create-database-using-code-first-migrations – Steve Greene Dec 15 '15 at 14:21

1 Answers1

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.

joaoruimartins
  • 537
  • 4
  • 14