共用方式為


CreateInPlace (Visual Studio 範本)

更新:2007 年 11 月

指定是否要建立專案並且在指定的位置上執行參數取代,或者在臨時位置上執行參數取代然後再將專案儲存到指定的位置。

<CreateInPlace> true/false </CreateInPlace>

屬性和項目

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

屬性

子項目

父項目

項目

描述

TemplateData

為範本分類,並定義在 [新增專案] 或 [加入新項目] 對話方塊中範本的顯示方式。

文字值

需要文字值。

此文字必須是 true 或 false。如果是 true,則會建立專案並且在 [新增專案] 對話方塊所指定的位置上執行參數取代。如果是 false,則會在臨時位置上執行參數取代,然後再將專案複製到指定的位置。

備註

CreateInPlacer 是選擇性項目。預設值為 true。

範例

下列程式碼範例說明 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 template</Description>
        <Icon>TemplateIcon.ico</Icon>
        <ProjectType>CSharp</ProjectType>
        <CreateInPlace>false</CreateInPlace>
    </TemplateData>
    <TemplateContent>
        <Project File="MyTemplate.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 範本