T4模板:将现有文件转换为运行时模板

设置文件的自定义工具属性设置为TextTemplatingFilePreprocessor。 在解决方案资源管理器,在该文件的快捷菜单上选择属性

如果已设置该属性,请确保它是TextTemplatingFilePreprocessor而不TextTemplatingFileGenerator。 如果已具有扩展名的文件包含在发生这种情况 .tt

https://docs.microsoft.com/zh-cn/visualstudio/modeling/run-time-text-generation-with-t4-text-templates?view=vs-2015#related-topics

原文地址:https://www.cnblogs.com/imtudou/p/11384543.html