Passing a variable value to my web.config



Hi,


how to pass/poke a variable to my webconfig.

ex: After MSbuild i would like to pass the revision or changeset to my web.config, so that my application can read it from the web.config and display it on the application page.




You have two options for updating a value in web.config file


1. If you have FinalBuilder, it includes several xml actions that you can use to change the correct value in the web.config file. You can create a FinalBuilder script that is solely responsible for updating the correct value in the web.config file.

2. Use the powershell action to change the selected value in the web.config. Create a powershell script that takes a parameter (ie. the revision number) and injects it into your web.config. For the powershell action, the Script arguments should look something like this: myRevisionNo=%myRevisionNo%

Check out this page for more information regarding injecting values into web.configs

http://archive.arcware.net/2008/12/...owershell/