How to specify .net application web.config Variables at build time in Teamcity
Hi,
I wanted to update web.config app settings, connetion strings when creating the Team city build. How can I achieve this? I don't want to show connection string values. So wanted to remove it from Web.config and update the connection string during build/deploy time.
Thanks,
Amar
Please sign in to leave a comment.
Hi,
Please try to follow instructions from this blog post: Web.config transformation using TeamCity or follow this section in documentation.
I'm not looking at web.config transformations. my configs are already transformed. I wanted to remove connection strings from production config and pass it during build/deploy time something like team city configuration parameters.
You can add the first step in your build which would make needed changes in web.config file.
Also you can pass needed parameter into MSBuild script (you should replace . with _ in the property name) and then update web.config file using MSBuild XmlUpdate task (for example see http://stackoverflow.com/questions/1271840/how-do-i-update-an-xml-attribute-from-an-msbuild-script).
I have the same doubt.