I have a T4 template that generates classes from an xml file.
How can I add a dependency between the xml file and the template file so that when the xml file is mod
You can use AutoTT Visual Studio Extension.
This extension allows to configure triggers that will run a T4 template.
One of the possible triggers is a file change. In the sample configuration file in AutoTT page, the regular expression for the triggers matches all files in the specified folders (Controllers, Content), but you can change it so that it runs with a specific file only.
Chirpy is another option for doing this. And also T4 Regenerator, which does it in a different way.