Can't update files on save of edmx file in VS 2012


  • I have to individually save all the ".edmx" (working with Entity Framework) related files .tt(template files) to update the changes done to model.

    And the are .tt files user specific ?

    Can anyone suggest if this can be done by single save click.

    • Moved by Mike Fourie [MVP] Tuesday, December 18, 2012 2:14 PM Better forum than MSBUild (From:MSBuild)
    Tuesday, December 18, 2012 1:58 PM

All replies

  • Hi Digant,

    Welcome to the MSDN forum.

    Which approach do you use? Database First? Model First?

    On my side, I tested your problem with model first. I added or deleted a scalar property, and click Save (not Save All) to save edmx file. Then the entity class changed and saved. Could you please let me know your steps to reproduce your issue?

    In addition, the .tt files automatically change themselves based on edmx to generate corresponding entity class and context class, after you click Save button on edmx.

    Good day.

    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 20, 2012 2:50 AM
  • Hi Alexander,

    First of all Thanks for your reply.

    I have used Database First approach.

    Whenever I modified the database (MS SQL Server 2008 R2) say a table by modifying the columns property 

      (changing  datatype from string to int ) o

    or adding new table. I found that the changes were not reflected to .tt ,

    I was getting error for the table added / property added that it was not found or not matched.

    But I was able to find a way by saving the .tt and files specifically, then and then only the updates were reflected 

    to project, So I guess .tt and files were not being updated on save of .edmx file.

    -> In my pc I have VS 2010 and VS 2012(ultimate) both installed if this helps you.


    Friday, December 21, 2012 11:55 AM