How to Publish ASP.NET Web Site with Alternate Configuration Settings
I am working on a web project as a website, not a web application. How can I use a different config file depending on where it is hosted, so the local version uses my local SQL installation, but the published version uses a live database? e.g. connectionStrings.config is ignored (not published), connectionStrings.live.config is published as connectionStrings.config
I see a policy file setting, could this be something capable?
+1
a source to share
4 answers
There are several options for this. The easiest way is to use a web deployment project. ScottGu's post is detailed in this question.
For large projects, you need something like Nant or MSBuild and CruiseControl or TeamBuild.
I also posted something here when supporting complex configuration deployments
+3
a source to share