DbContext Template Change only recognized after vs2012 restart

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Jan Zimmermann
Posts: 2
Joined: Mon 25 Mar 2013 10:29

DbContext Template Change only recognized after vs2012 restart

Post by Jan Zimmermann » Mon 25 Mar 2013 10:50

Hi there,

I'am using Entity Developer 5.0.66.0 and VS2012.

I try to make an DbContext Model with Entity Framework 5 support and the copy template option in the Wizard. So far so good. My data classes and DbContext Classes have been created.

But if i change the template (implement INotifyPropertyChanged) nothing happend.

The Template is written to disk, but the data classes always created with the old Templates.. (seems to be some kind of caching Feature :cry: )

I try to change the edml and run custom tool, but as before the old template generate the classes.

Only if restart VS2012 the new Template takes over the Code Generation.

Please Help, thanks

edit: Ok, closing the edml and opening again seems to have the same effect as vs restart.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: DbContext Template Change only recognized after vs2012 restart

Post by Shalex » Tue 26 Mar 2013 17:20

Jan Zimmermann wrote:But if i change the template (implement INotifyPropertyChanged) nothing happend.
The code is regenerated only if the model is changed. If you modify template but model is without changes, nothing happens by design. So edit template and save it, then modify your model (e.g. move any entity on a diagram) and save it as well (or press the Save All button). Now check the generated code.

Does it help?

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: DbContext Template Change only recognized after vs2012 restart

Post by Shalex » Thu 28 Mar 2013 12:03

Supplement to my previous answer:
if template is opened via Tools > Entity Developer > Model Explorer (*.edml model should be opened and active in this case), saving its changes will mark the model as modified (the asterisk after the name on the tab). Save the model to regenerate the code.

Post Reply