Can't generate EF entity code from within VS
Posted: Tue 27 Jan 2015 16:31
I think somehow I've broken something in my project. I'm not sure how to best fix it.
The project has an EDML file called 3DEntities.edml. Under that node, there are dependent files which include:
3DEntities.Context.tt
3DEntities.edmx.Diagram (I had migrated this from an edmx so leftover?)
3DEntities.edps
3DEntities.info
3DEntities.ModelDiagram.View
3DEntities.tt
|_ 3DEntities.cs
|_ TABLE1.cs
|_ TABLE2.cs
|_ etc...
I don't know why there are two .tt files. The TABLE1 and TABLE2 are just stand ins for the 20-odd entities brought in from Database-First generation.
I edit the EDML in the VS-integrated EDML designer and add a new table (say, TABLE3). It is in the designer, but I cannot force a generation to occur. Not by saving the EDML, not by saving the TT files, and not by right clicking on anything and saying "Run Custom Tool". Compiling the app doesn't generate either, just compiles what's there.
If I open the EDML in Entity Developer standalone, and hit F7 to generate code, it will happily spit out a ton of new entities, including the ones already there, albeit with new file names, and namespaces.
So, I'm thinking the structure of the above files is wrong, with maybe some kind of disconnect between the EDML and TT files, and somehow saving EDML isn't updating the generated TT files or the files under them which should update. Can you point me to anything that might help me get the model and support files back into a state where saving the EDML changes updates/generates the entities that are currently under that context.tt?
Thanks
The project has an EDML file called 3DEntities.edml. Under that node, there are dependent files which include:
3DEntities.Context.tt
3DEntities.edmx.Diagram (I had migrated this from an edmx so leftover?)
3DEntities.edps
3DEntities.info
3DEntities.ModelDiagram.View
3DEntities.tt
|_ 3DEntities.cs
|_ TABLE1.cs
|_ TABLE2.cs
|_ etc...
I don't know why there are two .tt files. The TABLE1 and TABLE2 are just stand ins for the 20-odd entities brought in from Database-First generation.
I edit the EDML in the VS-integrated EDML designer and add a new table (say, TABLE3). It is in the designer, but I cannot force a generation to occur. Not by saving the EDML, not by saving the TT files, and not by right clicking on anything and saying "Run Custom Tool". Compiling the app doesn't generate either, just compiles what's there.
If I open the EDML in Entity Developer standalone, and hit F7 to generate code, it will happily spit out a ton of new entities, including the ones already there, albeit with new file names, and namespaces.
So, I'm thinking the structure of the above files is wrong, with maybe some kind of disconnect between the EDML and TT files, and somehow saving EDML isn't updating the generated TT files or the files under them which should update. Can you point me to anything that might help me get the model and support files back into a state where saving the EDML changes updates/generates the entities that are currently under that context.tt?
Thanks