CreateNewFolder element (Visual Studio templates)

Determines whether to check that the target directory where the project is to be created does not exist. If the directory does exist, a fresh directory can be created for the project. This setting is typically overridden by the NewProjectRequiresNewFolder(VsTemplate) registry flag (HKEY_LOCAL_MACHINE/SOFTWARE(/Wow6432Node)/Microsoft/VisualStudio/<version number>/Projects/<project GUID>) that all common project types use to determine whether to create a new project in a new directory.

<VSTemplate> <TemplateData> <CreateNewFolder>





Attributes and elements

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



Child elements


Parent elements

Element Description
TemplateData Required element.

Categorizes the template and defines how it displays in either the New Project or the Add New Item dialog box.

Text value

A text value is required.

The text must be either true or false, indicating whether or not a new container folder should be created when a project is created from the template.


CreateNewFolder is an optional element. The default value is true.

The value specified in the CreateNewFolder element is only honored by Visual Studio if the underlying project system supports it.


The following code example specifies not to create a new folder when a project is created from the template.

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

See also