Question

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

Was it helpful?

Solution

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="..." />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top