Not all .config files are being processed for variable substitution

Since we have a lot of appsetting variables they are stored in a separate file. We have one for each environment

environmentsettings.dev.config
environmentsettings.test.config
environmentsettings.preview.config
environmentsettings.prod.config

We use configuration transforms to point the web.config to the correct environmentsettings file. The issue we run into is that when we promote to an environment that environment’s environmentsettings file is skipped for the find and update variables step.

For example when we publish to preview the file environmentsettings.preview.config is skipped but all the other files are processed. A publish to prod then causes environmentsettings.prod.config to be skipped. This was working with Octopus 1.x . We just noticed the variables substitution not being made when we upgraded to 2.3

Hi Bob,

Thanks for reporting this. It seems quite strange that Octopus would look inside of all the files except the one named after the environment. Is it possible that you also have an “environmentsettings.config” file and that Octopus thinks “environmentsettings.preview.config” is a transformation file, and then deletes it?

Would it be possible to attach a full deployment log?

Paul

We do have an “environmentsettings.config” which is used locally.

Is there any way to tell Octopus to not treat files in a subfolder as transformation files?

Paul thanks for pointing me in the right direction. Just in case anyone runs into the same problem I found two solutions.

  1. Set the build action for environmentsettings.config in Visual Studio to none. This way the file won’t be included when pushed through Octopus and then the environment specify files won’t be treated as web transforms.

  2. Rename the files to environmentsettings-dev.config, environmentsettings-test.config, environmentsettings-preview.config, and environmentsettings-prod.config so Octopus doesn’t treat them as transformation files.

Thanks for the follow-up Bob.