I have imported on VS 2015 a MVVM solution developed under older versions (2010). I should to update an Entity Data Model, to add some fields to a table. So, I decided to modify the XML code (as I used to do in VS2010), and this works. But when I try to rebuild solutions, I get a lot of errors. After several researches, I found out that every change to the DataModel.edmx file (both via XML or graphic designer), causes the corresponding MyProject/MyProjectModel/DataModel.Designer.vb file to be completely deleted! I also noted that creating a new EDM file causes several files to be created under MyProject/MyProjectModel/ folder. in details, I found - NewModel.edmx - NewModel.vb - NewModel.context.vb - NewModel.Designer.vb (empty) - NewModel.tt - [Table].vb for every table in the model while in the older version just .edmx and .Designer.vb files were created, and all tables definitions and table-class mappings were included in [Model].Designer.vb. How can I resolve this bug? It would be better all model data would be in [Model].Designer.vb file. thans for help
They have changed how the generated files are generated and the specific files themselves.
When you are rebuilding the projects it is generating the new files under the new model. You can switch to this new model by making the necessary corrections and then going forward keep up with this new model.
Alternatively you can also open the edmx model in the model designer. Right click on the model and open select Properties and the menu (you could press Alt-Enter instead) to bring up the properties window (it could be already there).
In the properties windows, under the heading "Code Generation", "Code Generation Strategy" choose "Legacy Object Context" and try rebuilding again.
It should be ok though in some cases I have seen it still create some of the newer files without deleting the older ones. In that case delete the new ones after an update.