This project is read-only.

T4Toolbox usage

Jan 9, 2009 at 5:30 AM
I have installed T4Toolbox using the installer over my VS2008 Pro installation.

I can see the category "Code Generation" in my "New Item" dialog.

Although, when I choose to create a template, e.g. Generator or Template, only one file is inserted in my project; I think that all the support templates of the T4Toolbox should be inserted also.

Are there any instructions for the "manual" setup of the T4Toolbox templates in a project; which files are needed and which paths are they suppose to exist, in order the new templates to work and compile correctly?

I also find out that I would have to remove the tool that process the .tt files from each file properties for the T4Toolbox support templates; Is this correct?

Would it be easy to create a screencast to demostrate the use of the T4Toolbox? Basic stuff, not how to create templates...


Thanks,
George J.
Jan 9, 2009 at 10:22 AM
Edited Jan 9, 2009 at 11:34 AM
The supporting files are installed in "C:\Program Files\T4 Toolbox" directory. You can copy the supporting files to your project manually from this location. Their number can be significant, depending on which code generator you use. They are referenced with <#@ include file="T4Toolbox.tt" #> directives that rely on "IncludeT4Toolbox" setting added to IncludeFolders key in registry to locate the files.

Perhaps the following two articles will answer your question about instructions on using T4Toolbox templates in a project:

Yes, you need to remove the custom tool from "partial" .tt files because they are not meant to be compiled separately.

The screencast is a good idea. I've had it on my todo list for a while, but don't think I can get to it in the next couple of months.

Jan 9, 2009 at 1:53 PM
Edited Jan 9, 2009 at 2:00 PM

Oleg,

I hadn't installed Visual Studio 2008 SDK since this morning. I do not suppose it matters in using T4Toolbox.

I managed to have T4Toolbox running after I included the templates myself in my projects.

I didn't know about the registry setting for the template files. I checked the registry in my installation - the installer has entered the included folder registry key but it looks like Visual Studio is ignoring it...


George J.