Web config transformation

Was looking at the following page


And noticed that you can use variables. I have set some variables up and my site deploys fine into my test environment, but now I cannot run my site locally within the development environment. The IDE complains about the variables in the sites web.config file. Should the variables be set in the web.test.config and not the web.config file?


Thanks for reaching out. A good practice for this scenario is to leave the web.config as untouched as possible and just deal with the transform files. For your dev environment you could have a web.debug.config file that will transform your config file at build time with all the values needed for your local development environment.

Then you could have another transform file called web.[environment].config which would only be used by Octopus at deploy time which could have these variables on it. Unlike the IDE, Octopus won’t complain about the variables and it will just replace them during the deployment.

Hope that helps,


Thank-you for the reply. This confirmed my suspicion about the situation.