I\'m using VisualStudio Ultimate 2012 (Update 1) on Windows 7. I can get my T4 template to generate a file by: right click [tt file] | run Custom tool. That works g
One of our customers had exactly the same problem and GarethJ is correct, that this can't be done out-of-the-box.
However, you can write your own "TextTransform.exe" tool which provides the Visual Studio Automation API to the templates pretty easily. All you need to do is implement the ITextTemplatingEngineHost and the IServiceProvider interfaces and returning an instance of the DTE interface when one is requested.
That said: We wrote a Blog-Post about this scenario and published the Tool = Source Code as well.
One Note though: You need a properly licensed installation of Visual Studio on your build server for this to work.
matthid @ AIT