3

Is it possible to create a Visual Studio item template that generates from a T4 template?

My google-fu does not seem powerful enough to yield an answer!

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Daniel Elliott
  • 22,647
  • 10
  • 64
  • 82
  • Do you mean "...that generates a T4 template"? I.e. you want an option "Add New Item..." and then be able to select a t4 template? – Kurt Schelfthout Apr 30 '09 at 08:57
  • Not quite Kurt, What I want to do is have the T4 generate a file based on responses to a wizard on "Add new item ..." Hope that clarifies a little, Thanks! – Daniel Elliott Apr 30 '09 at 09:17

2 Answers2

4

Yes, you need to use GAX for that. It has a (rather limited implementation of) custom T4 host that allows you to use T4 as a template language.

Oleg Sych
  • 217
  • 1
  • 1
  • Thanks Oleg, This would have worked for me but I decided to do the text transformations in my "New item .." wizard as the GAX solution was a bit heavy for my needs. Thank you again, Dan – Daniel Elliott May 05 '09 at 09:31
0

Yes you can, actually ASP.NET MVC uses this approach when creating View item from Controller item

All the Best Muse VSExtensions

BALKANGraph
  • 2,031
  • 1
  • 15
  • 16