views:

78

answers:

1

When using code generation templates in visual studio, is it possible to get the current location of the .tt file when the 'custom tool' runs? Suppose my custom template lives in

c:\projects\something\template.tt

When it does its magic, is there a way to return the path above?

<#=PathOfCurrentTTFile #>

(so that PathOfCurrentTTFile == c:\projects\something\template.tt)

+2  A: 

Take a look at this article. There's some use of the Host.TemplateFile which is probably what you're looking for.

Peter Lillevold
that is perfect! thank you!
bluevoodoo1