0

I have tried following things

In package manager console.

 Enable-Migrations -ContextTypeName abc.DomainModel.DAL.abcDataContext -Force update-database -Verbose -Force AutomaticMigrationsEnabled = true; 

Default project in package manager console is abc.DomainModel

And I still get this error.

"Additional information: The model backing the 'abcDataContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269)."

Where am I making mistake ?

1
  • which line is causing the error? Commented Apr 18, 2016 at 8:47

1 Answer 1

1

Every time you change anything in your model classes, you need to call Update-Database from the package manager console.

So you run "Enable-migrations" one time, when you create your project, and Update-Database every time you change your Model.

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

2 Comments

In addition; when not using automatic migration, you can use add-migration to add the migration explicitly.
You could try to delete your Migrations folder and delete your database manually. Afterwards: Enable-Migrations Update-database (if you dont have any valuable data in it)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.