TemplateContent 項目 (Visual Studio 範本)

更新:2007 年 11 月

指定範本的內容。

<TemplateContent>
    ...
</TemplateContent>

屬性和項目

下列章節會說明屬性 (Attribute)、子項目和父項目。

屬性

子項目

項目

描述

ProjectCollection

選擇性項目。

指定多個專案範本的組織和內容。

Project

選擇性項目。

指定要加入至專案的檔案或目錄。

References

選擇性項目。

指定項目範本所需的組件參考。

ProjectItem

選擇性項目。

指定範本中所包含的檔案。

CustomParameters

選擇性項目。

指定當您從範本建立專案或項目時,所要使用的任何自訂參數。

父項目

項目

描述

VSTemplate

必要項目。

包含專案範本、項目範本或入門套件的所有中繼資料。

備註

TemplateContent 是必要項目。

範例

下列程式碼範例會示範 Visual C# 應用程式專案範本的中繼資料。

<VSTemplate Type="Project" Version="2.0.0"
    xmlns="https://schemas.microsoft.com/developer/vstemplate/2005">
    <TemplateData>
        <Name>My template</Name>
        <Description>A basic starter kit</Description>
        <Icon>TemplateIcon.ico</Icon>
        <ProjectType>CSharp</ProjectType>
    </TemplateData>
    <TemplateContent>
        <Project File="MyStarterKit.csproj">
            <ProjectItem>Form1.cs<ProjectItem>
            <ProjectItem>Form1.Designer.cs</ProjectItem>
            <ProjectItem>Program.cs</ProjectItem>
            <ProjectItem>Properties\AssemblyInfo.cs</ProjectItem>
            <ProjectItem>Properties\Resources.resx</ProjectItem>
            <ProjectItem>Properties\Resources.Designer.cs</ProjectItem>
            <ProjectItem>Properties\Settings.settings</ProjectItem>
            <ProjectItem>Properties\Settings.Designer.cs</ProjectItem>
        </Project>
    </TemplateContent>
</VSTemplate>

請參閱

參考

Visual Studio 範本結構描述參考

匯出範本精靈

其他資源

Visual Studio 範本