I've been digging for something to help manage deployments between environments and haven't found anything that开发者_高级运维 works as neatly as I'd like. At the moment, I've got a web project in vs2010 which needs specific parts of its web.config changed depending on the environment it's installed on. There are 3 configurations which fit all environments.
As it stands, we do the deploy with a windows installer (built by vs) and then edit the config by hand - a messy and error prone way of doing things.
I've been looking at the 'new' configuration manager way of doing web.config transformations - this is almost perfect for my project, but... We use the same installers (and therefore, the same build configuration) on the 3 environment 'types' I mentioned before (so I can't build and target 'Live' or 'Test').
If there was a way to have all three configs (i.e. web.live.config, web.dev.config, web.test.config) generated at the same time, deploying would just be a case of using (renaming) the correct one.
Any thoughts on this? I'm close to having a really nice deployment, but this last bit is proving difficult...
edit: I can't do this in windows installer code, as I have custom config sections, and I can't reference my project/dll from the installer...
Web config automation with t4
In the end I used that with the Chirpy plugin for VS, instead of the macro.
Dave
精彩评论