After updating Entity Framework model, Visual Studio does not see changes

前端 未结 9 1274
臣服心动
臣服心动 2021-01-30 20:07

If I do any changes to my EF 5.0 model, VS does not seem to see the changes. I have tried adding a new table, which shows up fine in the model, but then if I try to use it somew

9条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 20:39

    This is apparently a bug in the Entity Framework that the model does not get updated when your Edmx file is located inside a folder. The workarounds available at the moment are:

    1. Install VS 2012 Update 1 which should fix the bug.
    2. If you are not in a position to install Update 1, you will have to right click on the model.tt T4 template file and click run custom tool. This will update the classes for you.

    Hope that helps someone out there.

    Link: http://thedatafarm.com/blog/data-access/watch-out-for-vs2012-edmx-code-generation-special-case/

提交回复
热议问题