Guillermo Oramas R.
Guillermo Oramas R.

Reputation: 1303

Problems with the DbMigrator class and Entity Framework 5.0 update

Hi I'm working in a MVC3 application and with Code First Migrations to manage my DB. Yesterday I just update my EF library to the 5.0 version. I used to ran in my Global.asax file, specifically in the method Application_Start(), so when the application starts the update-database command will run. It was something like this:

var configuration = new Configuration();
var migrator = new DbMigrator(configuration);
migrator.Update();

But since the update I keep getting this exception, at the Migrator.Update() line.

enter image description here

I don't have any column with that name. I can understand this error. I check the Entity Framework 5.0 details and I didn't get any clue. And by the way If I run the Update-Database with the power-shell command prompt I don't get any error, my db updates correctly. Thanxs.

Upvotes: 1

Views: 427

Answers (1)

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364349

Looks like your site doesn't use EF 5 because CreatedOn column was part of __MigrationHistory table (in system tables) in 4.3.1 but was removed in EF 5.

Upvotes: 3

Related Questions