开发者

Output Path for Shared T4 Template

How can I specif开发者_JS百科y the output path of a T4 template?

When I add my T4 template using "Add as Link" to my project from $TemplatePath$, it generates the output file in $TemplatePath$, not $ProjectPath$. How can I specify that $ProjectPath is where the generated file is placed?


I got around this by having a master template in one location and then templates that imported that one (but did little else) in each project. Of course, that's not the nicest solution.


We typically use the same system that Jeff Yates mentioned with minimal (often single line) stub templates including the shared template.

You could also use Oleg Sych's T4Toolbox to project output to any directory you please.

However, the standard IVsSingleFileGenerator that T4's custom tool is built upon doesn't have any dials to turn to control it's output location and it's behavior in the case of linked files is as you describe.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜