I have my own template code generator system, compiling the code in a separate appdomain, from before VS2008 came out.
If you're interested, post a comment and I'll post an url to the code.
The code to use my templating engine is here, you can browse to it with a web browser or point a Subversion client at it. Note, the link that starts with here really does stop after the word, but the server-side WMD renderer leaks the link onto the following text.
Note that if you just copy the single file in that namespace, then it won't compile by itself, it requires some stuff in LVK.Delegates and LVK.Scripting, namespaces up a couple of levels from the link above. If you don't want to suck down the whole library, you'll need to extract the pieces it complains about one at a time until it compiles.
There is also a binary version of the library at /LVK_3_5/trunk/Binaries/Debug/LVK in the same repository. If you download that it's as simple as just adding a reference to it, and checking class LVK.Text.Templates.TextTemplate.
Unfortunately I don't have any examples for my library at the moment.
Basically, to use a template:
TextTemplate tt = new TextTemplate();
tt.Source = "... code here, check example file above ...";
tt.Compile();
String output = tt.Generate(singleObjectParameter);
Inside the template, which is basically all code that is inserted in a single method (which means that it's not as good as T4 in terms of being able to add methods easily, but you can use anonymous methods), you'll have access to the data object passed into it as a parameter named data.
So to just output the contents of the passed parameter:
<%= data %>
To repeat it:
<% for (Int32 index = 0; index < 10; index++) { %>
<%= data %>
<% } %>
If you have questions, send them to my email at [email protected].