C# 带向导和T4的visual studo项目模板

C# 带向导和T4的visual studo项目模板,c#,visual-studio,templates,visual-studio-2012,t4,C#,Visual Studio,Templates,Visual Studio 2012,T4,我正在寻找一个关于如何在Visual Studio 2012中使用向导创建项目模板的示例 我需要一个像MVC控制器的向导 当用户选择Add Item时,我想显示一个对话框,用户在其中输入一些输入参数,包括解决方案中的类 然后按OK生成一个表单(包括designer和resx),我们希望将其添加到项目中 目前,我有T4文件和一个已经执行此操作的程序,但使用外部工具(TextTransform.exe),复制解决方案文件夹中的文件并手动操作csproj文件 // Set text transform

我正在寻找一个关于如何在Visual Studio 2012中使用向导创建项目模板的示例

我需要一个像MVC控制器的向导

当用户选择Add Item时,我想显示一个对话框,用户在其中输入一些输入参数,包括解决方案中的类

然后按OK生成一个表单(包括designer和resx),我们希望将其添加到项目中

目前,我有T4文件和一个已经执行此操作的程序,但使用外部工具(TextTransform.exe),复制解决方案文件夹中的文件并手动操作csproj文件

// Set text transform program (this could change according to the Windows version)    
p.StartInfo.FileName = "C:\\Program Files (x86)\\Common Files\\microsoft shared\\TextTemplating\\11.0\\TextTransform.exe";

// Specify T4 template file    
p.StartInfo.Arguments = "-out " + "\"" + output + "\"" + " \"" + template + "\"";

//manipulating the csproj    
var formNode = new XElement(@"{http://schemas.microsoft.com/developer/msbuild/2003}Compile", new XAttribute("Include", fromPath));
                formNode.Add(new XElement(@"{http://schemas.microsoft.com/developer/msbuild/2003}SubType", "Form"));
    programNode.AddBeforeSelf(formNode);

在这一切中我看不出有什么问题。您有生成代码的T4模板,但您必须手动复制它?我有一个程序(winForms),它根据T4生成文件(form、resx和designer),将输出文件复制到解决方案文件夹中,并将文件添加到csproj。我需要一个项目模板来做同样的事情,就像MVC控制器项目模板一样。