FileUpdate Class

MSBuild

Replace text in file(s) using a Regular Expression.


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

Syntax

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

Example

Search for a version number and update the revision.

 Copy Code
            <FileUpdate Files="version.txt"
                Regex="(\d+)\.(\d+)\.(\d+)\.(\d+)"
                ReplacementText="$1.$2.$3.123" />
            

Inheritance Hierarchy

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

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.