Reputation: 36573
I have a couple of custom T4 templates that I want to regenerate any time my edmx file (in the same project) changes.
Somehow Entity Framework manages to figure out to refresh the POCO T4 template on save.....but I can't figure out how. At first I thought it had to do with the <DependentUpon>
tag in the csproj...but that doesn't seem to have any effect except for telling Visual Studio to group one file under another.
How can I get my custom T4 templates to regenerate when my edmx changes, like Entity Framework's POCO tempaltes do?
Upvotes: 1
Views: 775
Reputation: 1455
Have a look at this page http://www.olegsych.com/2009/11/t4-toolbox-automatic-template-transformation/ You might be able to create a custom tool to do what you want. A custom tool would be good because you register it on your system and you can set it as the default tool for edmx files. But that requires a bit of work. Using the T4 toolbox looks like it would be a better, quicker option for you.
Upvotes: 1