若要将项目名称用于 Visual C# 类文件 Class1.cs 中的命名空间,请使用下面的语法:
#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
#endregion
namespace $safeprojectname$
{
public class Class1
{
public Class1()
{
}
}
}在项目模板的 .vstemplate 文件中,在引用 Class1.cs 文件时请包括以下 XML:
<TemplateContent>
<ProjectItem ReplaceParameters="true">
Class1.cs
</ProjectItem>
...
</TemplateContent>