We recommend using Visual Studio 2017

CustomParameter 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 CustomParameter Element (Visual Studio Templates).

Contains a custom parameter name and value to use when a project or item is created from the template.

<CustomParameter Name="name" Value="value">  

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


NameRequired. The name of the parameter. The format for parameters is $name$.
ValueRequired. The replacement value for the parameter.

Child Elements


Parent Elements

CustomParametersGroups the custom parameters that are to be passed to the template wizard when the wizard makes parameter replacements.

When a template contains CustomParameter elements, every instance the Name attribute is replaced with the Value attribute in the created project or item files.

The following example shows how to use several custom parameters in a template. When a project or item is created from a template with the following custom parameters, all instances of $color1$ and $color2$ in the template files will be replaced with Red and Blue, respectively.

    <CustomParameter Name="$color1$" Value="Red"/>  
    <CustomParameter Name="$color2$" Value="Blue "/>  

CustomParameters Element (Visual Studio Templates)
Template Parameters
Visual Studio Template Schema Reference