Little Gem for MSBuild

Just when I thought I had closed out my blog for the year, I stumbled across a post in the MSBuild forum.  Victor Chen is one of those forum monitors that knows his stuff inside and out.  He happened to post a reply to someone about updating config files and I had forgotten this little gem was available in MSBuild.  You can easily update files with something like this:

<FileUpdate Condition=” ‘$(Configuration)|$(Platform)’ == ‘Foo1|Foo2′”
                Files=”$(Configuration)Web.Config”
                Regex=”Foo=&quot;sth1&quot;”
                ReplacementText=”Foo=&quot;sth2&quot;” />

Keep this in your toolkit.  It could help you out in a pinch.

Happy coding!

Unknown's avatar

About JohnHowell

I am a professional software developer with over 20 years of experience. I currently specialize in Microsoft technologies such as VS, TFS, C#, VB.Net, WCF, WPF, WW, etc.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment