zoukankan      html  css  js  c++  java
  • EF Code First(The model backing the '***' context has changed since the database was created.解决方法)(CSDN手动迁移)

    错误消息:

    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).

    错误原因:

    (1)数据模型发生改变,而没有更新到数据库导致此问题。

    事实上我遇到的情况不是原因(1),而是(2)造成的

    (2)更新到数据库 用的EF 6.1.0 ,而数据访问层用的是EF 6.0.2

    解决方法:

    (1)用Code First  更新数据库,命令如下:

    Add-Migration
    Update-Database -Verbose

    (2)数据访问层换成EF 6.1.0 ,问题解决

  • 相关阅读:
    LeetCode
    LeetCode
    LeetCode
    深度学习笔记 (二) 在TensorFlow上训练一个多层卷积神经网络
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
  • 原文地址:https://www.cnblogs.com/hetring/p/4611231.html
Copyright © 2011-2022 走看看