We recommend using Visual Studio 2017

Project Element (Visual Studio Templates)


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Project Element (Visual Studio Templates).

Specifies the files or directories to add to the project.



The following sections describe attribute, child elements, and parent elements.


FileRequired attribute.

Specifies the name of the project file in the template .zip file.
ReplaceParametersOptional attribute.

A Boolean value that specifies whether the project file has parameter values that must be replaced when a project is created from the template. Default value is false.
TargetFileNameOptional attribute.

Specifies the name of the project file when a project is created from the template.
IgnoreProjectParameterOptional attribute.

Specifies whether the project should be added to the current solution. If the value of custom parameter, "$myCustomParameter$" exists in the parameter replacement file, the project is created but not added as part of the currently open solution.

Child Elements

FolderOptional element.

Specifies a folder to add to the project.
ProjectItemOptional element.

Specifies a file to add to a project.

Parent Elements

TemplateContentRequired element.

Project is an optional child element of TemplateContent.

The Project element is used to specifiy a project, and therefore, is only valid in project templates.

Project elements can have Folder children elements or ProjectItem children elements, but not a mixture of both Folder and ProjectItem children elements.

Visual Studio automatically renames the project file name based on the name entered by the user in the New Project dialog box. Use the TargetFileName attribute if you want to provide an alternate file name for project files created with the template.

The following example shows the metadata for a project template for a Visual C# application.

<VSTemplate Type="Project" Version="3.0.0"  
        <Name>My template</Name>  
        <Description>A basic starter kit</Description>  
        <Project File="MyStarterKit.csproj">  

Visual Studio Template Schema Reference
Creating Project and Item Templates
ProjectItem Element (Visual Studio Project Templates)
Folder Element (Visual Studio Project Templates)