Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Template parameters let you replace identifiers such as class names and namespaces when a file is created from a template. You can add template parameters to existing templates, or create your own templates with template parameters.
Template parameters are written in the format $parameter$. For a complete list of template parameters, see Template parameters.
The following section shows you how to modify a template to replace the name of a namespace with the "safe project name".
Example - namespace name
To follow this procedure, you need an existing template. If you don't have one, see Create project templates to learn how to export a project or solution to a template, or Create item templates.
Insert the parameter in one or more of the code files in the template. For example:
namespace $safeprojectname$
In the vstemplate file for the template, locate the
ProjectItem
element that includes this file.Set the
ReplaceParameters
attribute totrue
for theProjectItem
element:<ProjectItem ReplaceParameters="true">Class1.cs</ProjectItem>