0

I would like to be able to delete a project reference in a solution file via MSBuild.

I am assuming I can do this using the FileUpdate task; however, I am not sure how you turn on the multiline regex feature. Essentially, I need to delete a reference such as: delete everything between Project and EndProject where those lines contain DELETEME. I know I can use word boundaries if I knew how to turn on the mulltiline feature. IF someone has a better idea that is welcome too. Thank you:

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DELETEME", "DELETEME.csproj", "{08F67FEA-5A63-4A46-B38F-
26EF15E003A9}"
EndProject

<FileUpdate
  Files="PATH TO SOLUTION"
  Regex="PATTERN"
  ReplacementText=" " />

I can't find documentation on the parameters of this task anywhere either :/ Maybe something like RegexOptions = "Multiline"

Mike Veigel
  • 3,795
  • 2
  • 20
  • 28

1 Answers1

0

I would personally prefer writing a custom activity which does the cleaning for me.

Ewald Hoffman has a series of blog posts about customizing Team Build workflows. Part 5 especially describes a writing a custom activity to automatically update assembly version, which, with a little change, can be applied to your situation.
http://www.ewaldhofman.nl/post/2010/05/13/Customize-Team-Build-2010-e28093-Part-5-Increase-AssemblyVersion.aspx

e-mre
  • 3,305
  • 3
  • 30
  • 46
  • I will give this a shot once we migrate our builds to TFS 2010. Was hoping to come up with a solution that didn't involve custom task since in 2010 you can write it directly in the build file as opposed to using a custom dll. At any rate, thank you for the suggestion and ill let you know how it goes. – Mike Veigel Jun 15 '11 at 21:40