geeTee
geeTee

Reputation: 1147

Is it possible to edit files during a Team Build?

I'm looking for a way to edit a configuration file (web.config in an asp.net project) in a Team Build.

Specifically I'm looking at either uncommenting or adding identiy impersonate in the config file before copying the built web application to its destination.

I know that it's possible to have multiple config files and copy one over the other (we're using this approach to have different configurations for development, production, demo, etc), but in this case it would be nice to keep the configuration in a single file since the only change here is whether or not identity impersonate should be false or true.

I've been googling for a while now without finding any solution to this, but maybe there are someone here which could either help me figure out how or simply state that it's not possible. Any ideas?

Upvotes: 2

Views: 220

Answers (2)

Josh Gallagher
Josh Gallagher

Reputation: 5329

The XmlPoke msbuild 4.0 task will help you, and this is buit in. Here's the link: http://msdn.microsoft.com/en-us/library/ff598687.aspx

Upvotes: 1

James Ogden
James Ogden

Reputation: 852

Have a look at http://www.codeplex.com/sdctasks

It's a set of build tasks which allow you to do all sorts of fun things. There are several tasks which are web(site) related, but if it comes to it, there are XML tasks too which should allow you to manipulate the file appropriately

Upvotes: 1

Related Questions