T4 Templates - Generates Unit Test classes from the classes which implement an interface @user1266921 What you mention is a EF specific functionality implemented via EntityFrameworkTemplateFileManager class as documented here msdn.microsoft.com/en-us/library/ff477603.aspx. So if you don't mind the EF reference, using this could also be a solution. Or of course you can implement a similar thing yourself or use some other implementation. Still the out of the box behavior of the T4 is one output file with the same name as the the template and the extension specified by the <#@ output #> directive and the approach I proposed is IMHO the easiest way to achieve what you need.