EF Code First (the model backing the ' * * * ' context has changed since, the database was created. Workaround) (CSDN Manual migration)

Source: Internet
Author: User
Error message:

The model backing the ' * * * ' context has changed since, the database was created. Consider using Code first migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).

Cause of Error:

(1) The data model has changed, and the problem is caused by not updating to the database.

In fact, the situation I encountered is not the cause (1), but (2) caused by

(2) Update to the EF 6.1.0 for the database, and the data Access layer is EF 6.0.2

Workaround:

(1) To update the database with code first, the command is as follows:

Add-migration
Update-database-verbose

(2) Change the data access layer to EF 6.1.0, solve the problem

EF Code First (the model backing the ' * * * ' context has changed since, the database was created. Workaround) (CSDN Manual migration)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.