How to Pass Parameters to the T4 Code Generator: The Beginning

Published 23 October 08 11:06 AM | jons 

I am using the T4 code generator that is a part of Visual Studio 2008.  T4 transforms a model specifications into code guided by a template.  I am using an XML file as my model specification.  What I want to do is to be able to pass parameter values into the templates: the path to the input model specification file, the path to where the output files should end up, and perhaps an option or two.  This is critical if we want to foster reuse.  I do not know how to do pass parameters and, to be honest, I do not know if it is possible.  I assume that it is because, as I understand it, the T4 processor is used to generate all sorts of code with Visual Studio and it must be passing parameters.  I am starting out on a quest.  I typically blog in the long form, but for this effort, I am going to blog little items as I go along.

What is the first step?  Search the web to see if someone else has already done it?  Be back in a bit.

New Comments to this post are disabled

About jons

Jon Stonecash is a technology consultant and has been designing, developing, and testing various kinds of software for such a long time that he has had the opportunity to make most of the serious software development mistakes at least once. His long term interests center about databases and the aspects of the application that handle data access and business logic. He is also interested in the tools that assist the development process, particularly code generation.