Skip to main content

Posts

Showing posts with the label local

Having different config for local dev and remote deployment for web.config

I have been maintaining 2 different Web.Config files for ages, one for developement and one for live or remote deployed sites. This is to say the least a pain. When you deploy your website you then need to remember to either copy the old config and replace or you need to edit the live one with the correct connection strings and the like. While looking for a solution to a security related problem on a deployment of an ASP.NET site I came across this site: http://www.troyhunt.com/2010/11/you-deploying-it-wrong-teamcity.html 2 Web Config files... The essence of this shows how you can have a core web.config then you can have a debug web.config and a depolyed web.config. To do this all you do is in your Visual Studio project simply right-click the web.config file and select "Add Config Transforms". If it is greyed out / disabled then check if two  files exists under Web.Config One called Web.Debug.Config and once called Web.Release.Config. These two files let you...