TemplateFile Class

MSBuild

MSBuild task that replaces tokens in a template file and writes out a new file.


Namespace: MSBuild.Community.Tasks
Assembly: MSBuild.Community.Tasks (in MSBuild.Community.Tasks.dll)

Syntax

Visual Basic (Declaration)
Public Class TemplateFile
    Inherits Task
C#
public class TemplateFile : Task
C++
ref class TemplateFile : Task
J#
public class TemplateFile extends Task
JScript
public class TemplateFile extends Task

Example

 Copy Code
            <ItemGroup>
                <Tokens Include="Name">
                    <ReplacementValue>MSBuild Community Tasks</ReplacementValue>
                </Tokens>
            </ItemGroup>
            
            <TemplateFile TemplateFile="ATemplateFile.template" OutputFile="ReplacedFile.txt" Tokens="@(Tokens)" />
            

Remarks

Tokens in the template file are formatted using ${var} syntax and names are not case-sensitive, so ${Token} and ${TOKEN} are equivalent.

Inheritance Hierarchy

System.Object
   Microsoft.Build.Utilities.Task
      MSBuild.Community.Tasks.TemplateFile

Thread Safety

Public static (Shared in Visual Basic)staticShared members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

See Also

Syntax based on .NET Framework version 2.0.
Documentation version 1.0.0.0.