According to your description above, it's recommended to enable Code First Migrations first.
The Migrations feature enables you to change the data model and deploy your changes to production by updating the database schema without having to drop and re-create the database.
Please follow this tutorial to do Code First Migrations and deployment with
the Entity Framework in an ASP.NET MVC application first.
If it still has same issue, please let me know.
Best regards
Angie Xu
migrationmvcCode Firstdeploy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
I have enabled migrations and everything was well, but then suddenly the error described above started.
I tried to find the couse for this and it was errors in my code.
To be exact, I included Elmah.Mvc package in my MVC 5 project. That package was stopping Entity framework from working well. I noticed that scaffolding of new Controllers and views was not working and it gave me some strange errors. I removed Elmah.Mvc package
and then it gave me errors that entity framework doesn't understand what elmah means in Web.Config file.
I cleaned Web.Config file from all elmah stuff and then included ordinary Elmah package and everything worked well.
Member
1 Points
5 Posts
Problem with EF Code first migrations and deployment
Feb 25, 2014 08:27 AM|gliba008|LINK
Hello everybody, we have a problem with deployment of our MVC web app to IIS server.
My Web.Config looks like this:
My DbContext looks like this:
The problem is that there is no Execude Code First Migrations checkbox (see the picture):
thank you for your help
migration mvc Code First deploy
All-Star
32817 Points
3815 Posts
Re: Problem with EF Code first migrations and deployment
Feb 26, 2014 09:12 PM|Angie xu - MSFT|LINK
Hi gliba
Thanks for your feedback in asp.net forum.
According to your description above, it's recommended to enable Code First Migrations first.
The Migrations feature enables you to change the data model and deploy your changes to production by updating the database schema without having to drop and re-create the database.
Please follow this tutorial to do Code First Migrations and deployment with the Entity Framework in an ASP.NET MVC application first.
If it still has same issue, please let me know.
Best regards
Angie Xu
migration mvc Code First deploy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
1 Points
5 Posts
Re: Problem with EF Code first migrations and deployment
Feb 27, 2014 06:28 AM|gliba008|LINK
Hello Angie and thank you for your reply.
I have enabled migrations and everything was well, but then suddenly the error described above started.
I tried to find the couse for this and it was errors in my code.
To be exact, I included Elmah.Mvc package in my MVC 5 project. That package was stopping Entity framework from working well. I noticed that scaffolding of new Controllers and views was not working and it gave me some strange errors. I removed Elmah.Mvc package and then it gave me errors that entity framework doesn't understand what elmah means in Web.Config file.
I cleaned Web.Config file from all elmah stuff and then included ordinary Elmah package and everything worked well.
Best regards,
Marin Glibić
migration mvc elmah Code First deploy