学着TerryLee 的把生成代码输出到文件的方式( 原贴地址).但总是在在属性框里不出现任何东西呢。结果如下图: 我用的是CodeSmith v2.6,模板为: % @ CodeTemplate Language = " C# " TargetLanguage = " C# " Inherits = " OutputFileCodeTemplate " Description = " Build custom access code. " %> <% @ Assembly Name = " CodeSmith.BaseTemplates " %> <% @ Assembly Name = " CodeSmith.CustomProperties " %> <% @ Import Namespace = " CodeSmith.CustomProperties " %> <% @ Import Namespace = " System.IO " %> <% @ Import Namespace = " System.Windows.Forms.Design " %> <% @ Assembly Name = " System.Design " %> < script runat = " template " > // Override the OutputFile property and assign our specific settings to it. [FileDialogAttribute(FileDialogType.Save, Title = " Select Output File " , Filter = " C# Files (*.cs)|*.cs " , DefaultExtension = " .cs " )] public override string OutputFile { get {return base.OutputFile;} set {base.OutputFile = value;}} </ script > <%= OutputFile %> 先谢谢了,再多问一句那个OutputFileCodeTemplate在哪里可以找到呀?我在我的CodeSmith目录下怎么找不到呢? 转载于:https://www.cnblogs.com/gjahead/archive/2007/05/15/747169.html