This is a great way of automating the deployment of the correct settings to your Dev, Test and Production Environments - courtesy of Scott Gu:
Use ASP.NET Web Application Projects (which have MSBuild based project files) Open the VS Configuration Manager and create new "Dev", "QA", "Staging" build configurations for your project and solution Add new "web.config.dev", "web.config.qa", and "web.config.staging" files in your project and customize them to contain the app's mode specific configuration settings Add a new "pre-build event" command to your project file that can automatically copy over the web.config file in your project with the appropriate mode specific version each time you build the project (for example: if your solution was in the "Dev" configuration, it would copy the web.config.dev settings to the main web.config file).Once you follow these steps, you can then just pick the mode your solution is in using the configuration drop-down in the VS standard toolbar
For more, see:
http://weblogs.asp.net/scottgu/archive/2007/09/21/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005.aspx
No comments:
Post a Comment