<#@ template debug="false" hostspecific="false" language="C#" #>
What does hostspecific attribute signify here.
To debug a design-time text template, save the text template file, and then choose Debug T4 Template on the shortcut menu of the file in Solution Explorer. To debug a run-time text template, simply debug the application to which it belongs.
T4 uses a custom template format which can contain . NET code and string literals in it, this is parsed by the T4 command line tool into . NET code, compiled and executed. The output of the executed code is the text file generated by the template.
A template with hostspecific set to "true" can access a member this.Host
of type ITextTemplatingEngineHost
(MSDN). You can then use e.g. its method "ResolvePath" in order to locate files needed for input in the template.
This is even more useful when you use a custom templating engine. See Oleg's blog here: http://www.olegsych.com/2008/02/t4-template-directive/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With