Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我“运行”一个 T4 模板时,它为我生成的类文件都出现在模板下。如果文件不消失,我无法从项目中删除模板。我也无法将文件从模板“下”复制到项目根目录中,因为它们已经在项目根目录中。如何从创建它们的模板中解放这些文件?
发挥创意:
如果您想使用 T4 进行一次性代码生成,那么我建议使用T4 脚手架。这个工具最初是为了支持在MVC3中生成视图、控制器等,但你几乎可以在任何东西上使用它。