【问题标题】:When running TextTransform.exe, how to distinguish between TextTemplatingFilePreprocessor and TextTemplatingFileGenerator?运行TextTransform.exe时,如何区分TextTemplatingFilePreprocessor和TextTemplatingFileGenerator?
【发布时间】:2012-02-07 22:05:50
【问题描述】:

运行TextTransform.exe时,如何区分TextTemplatingFilePreprocessor和TextTemplatingFileGenerator? 我不能像大多数人所说的那样使用 msbuild,所以我正在寻找具体的东西:如何在命令行中为给定的 TT 文件运行 TextTemplatingFilePreprocessor。 谢谢!

【问题讨论】:

    标签: msbuild t4 css


    【解决方案1】:

    不幸的是,TextTransform.exe 不支持预处理。如果您不能使用 msbuild 任务(请记住,您可以使用 msbuild 独立在其他进程中执行此步骤),那么您可以编写自定义主机。 MSDN 上有一个示例,地址为http://msdn.microsoft.com/en-us/library/bb126519.aspx

    【讨论】:

    • 谢谢。我创建了一个自定义主机,它工作正常,但这会导致 TextTemplating 为我的每个 TT 文件(嵌入为资源)构建一个程序集 runtime。我更喜欢“预处理器”方法,因为它为我提供了与代码一起构建的最终类。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-06
    • 1970-01-01
    • 2012-05-31
    • 2017-05-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多