Re: web config file



SalamElias,
Yes you build a class that implements the ITask interface (although
inheriting from Microsoft.Build.Utilities.Task, which implements ITask &
some other "plumbing", is easier).

http://msdn2.microsoft.com/en-us/library/t9883dzc.aspx

http://blogs.msdn.com/msbuild/archive/2006/01/21/515834.aspx

(actually most if not all the articles on http://blogs.msdn.com/msbuild)

This task can accept "parameters" in the form of properties or items.

I would probably use System.Xml, possibly XSLT to create and/or modify an
"template" app.config to the specific target environment (Dev, Test, staging
and production). How I implemented it really would depend on how generalized
I wanted it (as others may find it useful).

NOTE: I haven't used them, the XmlRead, XmlWrite, and/or Xslt tasks from
"MSBuild Community Custom Build Tasks, may do what you need:

http://blogs.madtechnology.net/blogs/chris/archive/2006/02/16/605.aspx


--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


"SalamElias" <eliassal@xxxxxxxxxxxxx> wrote in message
news:0AFB9D68-7805-439B-BAA9-97F9B6E924B5@xxxxxxxxxxxxxxxx
| Thanks jay for your response, can you please explain more? I have never
used
| custom tasks, I onluy have a job to do a nightlt build? what do you mean
by a
| custom task? is it something like coding a new calss to write the web file
or
| it is something out of the box in TFS for config files?
| Thanks again
|
| "Jay B. Harlow [MVP - Outlook]" wrote:
|
| > SalamElias,
| > If you're using Team Foundation Server (TFS) have you considered
creating a
| > custom build task that is able to "build" the respective config file?
| >
| > --
| > Hope this helps
| > Jay B. Harlow [MVP - Outlook]
| > ..NET Application Architect, Enthusiast, & Evangelist
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > "SalamElias" <eliassal@xxxxxxxxxxxxx> wrote in message
| > news:74B51D35-E17B-4F47-9BE0-06CBCBB276A8@xxxxxxxxxxxxxxxx
| > | Hi, I am confornted with a problem regarding web.config file. I have 4
| > | environements (Dev, Test, staging and production). The IT people need
| > | wgenever a new MSI delivered to have the right environment keys in
there
| > | sections and not the dev machines web config. What I mean by that I
don't
| > | want the IT people to edit the web config for each environement
manually.
| > Is
| > | there any baset practices or patterns to automatically deploy goof
| > web.config
| > | files.
| > | I use TFS for nightly builds and thinking of implememnting TFS a s the
| > tool
| > | which should be used by IT people to get delivarables in order to
deploy
| > them
| > | instead of filling special froems and using files shares for
delivarables.
| > | Of course, I know that we can exclude the web.config from the msi and
| > every
| > | delivery people go and update manullay the file in another environment
but
| > I
| > | dont want that either if possible of course.
| > | Thanks.
| >
| >
| >


.