Visual Studio 2008 ネイティブまたは Visual Studio 2005 SDK に付属する T4 テンプレートを使用すると、必要なものをほとんど生成できます。
次のリンクで詳細を確認できます。
これらのリンクはすべて、あなたの探求の良いスタートになると確信しています。
Visual Studio の外部で T4 テンプレートを生成する場合は、T4 テンプレートを呼び出すカスタム MSBuild タスクがあります (リンク)
MSBuild タスクの「実行」コードのサンプルを次に示します。ソースコードはこちら:
public override bool Execute()
{
bool success = false;
//read in the template:
string template = File.ReadAllText(this.TemplatePath);
//replace tags with property and item group values:
ProjectHelper helper = new ProjectHelper(this);
template = helper.ResolveProjectItems(template);
//copy the template to a temp file:
this._tempFilePath = Path.GetTempFileName();
File.WriteAllText(this._tempFilePath, template);
//shell out to the exe:
ProcessHelper.Run(this, TextTransform.ToolPath, TextTransform.ExeName, string.Format(TextTransform.ArgumentFormat, this.OutputPath, this._tempFilePath));
success = true;
return success;
}