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

5 comments
Comment actions Permalink

Hi,

Please try to follow instructions from this blog post: Web.config transformation using TeamCity or follow this section in documentation.

0
Comment actions Permalink

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.

0
Comment actions Permalink

You can add the first step in your build which would make needed changes in web.config file.

0
Comment actions Permalink

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).

0
Comment actions Permalink

I have the same doubt.

0

Please sign in to leave a comment.