This project is read-only.

Getting rid of the unnecessary one output file when generating multiple output files with a Generator

Aug 10, 2010 at 6:04 PM

Hey experts,

suppose I have a T4 template to generate multiple files as described by Oleg here:
http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/

Unfortuantely, I always get one file which I need to delete. Say, our T4 file is MYSTUFF.tt, then in addition to the actually generated files from my generator I also get MYSTUFF.txt (or whatever extension you choose).

Is there any elegant way to avoid this altogether?

Thanks.

Aug 11, 2010 at 1:26 PM
Why?
Aug 11, 2010 at 1:47 PM

Hi.

Because it is empty... :) it seems like it gets generated 'by default' although I do generate different other files in the generator.
Thanks.

Aug 18, 2010 at 11:50 PM

There is no way I know of to get rid of the "default" output file with the standard T4 host. This file is a result of how the host is integrated in Visual Studio. T4 itself does not create it - Visual Studio does. For now, the best you can do is to generate something useful in it.

Hope this helps,
Oleg

Aug 24, 2010 at 11:05 AM

Thx Oleg, point taken.