【问题标题】:How to execute T4 template files in Visual Studio For Mac?如何在 Visual Studio For Mac 中执行 T4 模板文件?
【发布时间】:2021-09-23 17:46:01
【问题描述】:

我无法在 Visual Studio for Mac 或 Visual Studio 代码中运行文本模板。我试过了:

VS>右键项目>工具>处理T4模板>(未找到模板)

我还去了 Visual Studio 顶部菜单 > 扩展 >(搜索 T4)> IDE 扩展 > 文本模板 v8.10.6 已安装。

我正在尝试使用来自linq2db.SqlServer. 的 *.tt 模板。但是运行任何基本的 T4 模板都会让我知道 TextTemplatingFileGenerator 至少可以工作。那里的文档指出:

Make sure that custom tool for your tt file set to TextTemplatingFileGenerator, otherwise it will not run

虽然没有说明如何实际完成这项任务?

我还在 Visual Studio 代码中安装了TT-Processor。我也无法执行 *.tt 文件。在这种情况下,当我右键单击 *.tt 文件时,我没有看到执行/运行命令。

【问题讨论】:

    标签: macos t4 visual-studio-mac


    【解决方案1】:

    微软为我回答了这个问题。正如我已经提到的,没有人谈论的部分是这个问题的答案:

    Make sure that custom tool for your tt file set to TextTemplatingFileGenerator, otherwise it will not run
    

    在 Visual Studio 中右键单击 *.tt 文件 > 属性 > 自定义工具 > 选择“TextTemplatingFileGenereator”

    现在,当您右键单击项目 > 工具 > 处理 T4 模板时,Visual Studio 会找到 *.tt 文件

    可以说,这种体验应该被改进为默认为这种行为,以适应“落入成功之坑”的哲学。

    【讨论】:

    • 感谢您的回答,不知道为什么这个问题被标记了 - 但它有帮助,非常感谢您的提问和回答!
    猜你喜欢
    • 2018-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-11
    • 1970-01-01
    相关资源
    最近更新 更多