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
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:
Hope that helps someone out there.
Link: http://thedatafarm.com/blog/data-access/watch-out-for-vs2012-edmx-code-generation-special-case/
First Build your Project and if it was successful, right click on the "model.tt" file and choose run custom tool. It will fix it.
Again Build your project and point to "model.context.tt" run custom tool. it will update DbSet lists.
Right click the .tt
file and select "Run Custom Tool", that should update it:
I've also experienced this problem with none of the classes being generated under the model.tt file. In my case it was down to issues with how I had built the DB in SQL2012. I'd set a column in a table to nullable that was also a foreign key and although I think you should be able to do this it caused a problem in EF5.
As soon as this was cleared and the diagram updated from the database they reappeared.
EF5 VS2013
I searched for this answer because I had a similar situation in VS2013. In my case, I found that a simple "Clean Solution
" cleared out all the old definitions.
I also had this problem, however, right-clicking on the model.tt file and running "Custom tool" didn't make any difference for me somehow, but a comment on the page Ghlouw linked to mentioned to use the menu item "BUILD > Transform All T4 Templates." which did it for me