views:

216

answers:

2

I've been running into alot of limitations with the web.config replacement code in VS 2008's Web Deployment Project. Some of these seem to be:

  • Sectionsgroups cannot be replaced, only sections. Now if I just knew what sections was.
  • There seems to be some requirement behind the replacement. It's not just a "dumb" textual replacement. This makes it difficult to replace custom additions to the web.config (seems the files backing the sections needs to be in the GAC or something similar).

So thinking instead that it would be easier to simply write my own replacement program, which is "dumber", but without these limitations. So before setting off, I wonder if there's something else out there which:

  • Works on XML files
  • Given an INI file like list of key/values
  • Can replace elements in the original XML file, with textual content loaded in from textfiles indicated by the values in the INI file.

Or am I doing something totally wrong here? The WDP's config replacement code just seems fairly useless (and hard to find documentation for).

+1  A: 
Nicholas Piasecki
While the solution of maintaining completely different web.config file is what I ended up using, it does strike me as rather annoying, being forced to duplicate information, but such is life.
Svend
A: 

disclaimer: I'm going to spam you by talking about my program I've written to do this

I've written something to do this: dashy. It's slightly involved to set up (maybe, depends on your environment), but it is designed to solve exactly the problem you have - managing your configs for different environments (and additionally, the deployment thereof).

Alternatively, pre-dashy, I just used nant tasks with specific .properties for each environment, and execute the relevant one, post build.

Noon Silk