【发布时间】:2021-08-26 22:30:43
【问题描述】:
我正在尝试为 .net 核心应用程序创建运行时文本模板,但我没有将 TextTemplatingFilePreprocessor 视为属性窗格中的自定义工具选项。我要做的就是创建一个文本模板,该模板将生成一个文本文件,其中包含基于用户的一些输入填充的变量
SampleMethod(string parameter1, string parameter2)
{
string filetext = ProcessTemplate(string template, var parameters)
}
【问题讨论】:
-
我用的是T4,但是在代码文件中看不到如何实际设置参数
-
你可以在stackoverflow.com/questions/59443320/…找到几个例子
-
我想通了,我一定是没有正确拼写自定义工具
标签: c# .net .net-core texttemplate