您可以将自定义T4模板添加到VS2008的“添加新项"中吗?对话? [英] Can you add custom T4 Templates to the VS2008 "Add New Item" dialog?
问题描述
我创建了一组模板,希望在多个项目中共享.是否可以将模板添加到添加新项"对话框中,以便当我选择它时从模板生成代码文件实例并将其添加到项目中?
I have created a set of templates that I want to share across multiple projects. Is it possible to add the template to the Project "Add New Item" dialog such that when I choose it an instance of the code file is generated from the template and added to the project?
感谢您的建议Preet.回答了这个问题,但我想我问错了.再想一想,我现在希望能够自动化T4模板的处理并将参数从用户输入传递给它们.
Thanks for suggestions Preet. That answers the question but I think I have asked the wrong one. Thinking about it some more, I now want to be able automate the processing of T4 templates and pass parameters to them from user input.
我现在从一个新的角度看待这个问题.专门尝试使用Microsoft.VisualStudio.TextTemplating.Engine
类和GAX自己从模板生成代码文件.
I'm now looking at this from a new angle. Specifically attempting to use the Microsoft.VisualStudio.TextTemplating.Engine
class and GAX to generate code files from templates myself.
推荐答案
Can't see why not - you just create an Item template. See here and here for more details
这篇关于您可以将自定义T4模板添加到VS2008的“添加新项"中吗?对话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!