在大家的帮助下,终于写成了创建输出目录的模板,再次还是感谢所有的热心的朋友。现在还是回到我们的正题来。要创建输入模板主要是写程序集的引用和命名空间的引用。完整的模版代码如下: <%@ CodeTemplate Language="C#" TargetLanguage="Text" Debug="True" Description="Template description here." %><%@ Assembly Name="SchemaExplorer" %><%@ Assembly Name="CodeSmith.CustomProperties" %> <%@ Assembly Name="System.Design" %><%@ Import Namespace="System.IO" %><%@ Import Namespace="SchemaExplorer" %><% if(!Directory.Exists(OutputDirectory)) Directory.CreateDirectory(OutputDirectory); %><script runat="template">> 这里需要说下,主要是以上的引用一个都不能少,我最开始就是因为引用得不够,才困惑了很久。 相关文章: 2021-11-28 2022-02-07 2021-12-22 2022-12-23 2021-11-20 2021-09-26 2021-06-04 2021-05-26