Edit xml using regular expression in msbuild?

504 views Asked by At

i am working with msbuild script.i want to comment particular line using regular expression in msbuild .pls help me to solve this issue??please give one example other than editing version using regular expression

1

There are 1 answers

2
sll On BEST ANSWER

You can do this using FileUpdate MSBuild Community Tasks:

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

<ItemGroup>
   <FilesToBeUpdated Include="/Output/test.xml" />
</ItemGroup>

<FileUpdate
   Files="@(FilesToBeUpdated)"
   Regex="..."
   ReplacementText="..." />