I’m just having a bit a trouble getting the Additional Transforms working for one of my projects. I have 3 config files I would like to transform; Web.config in the root of the project, and AppSettings.config and ConnectionStrings.config in a folder called “settings”. I have Octopus Deploy set up as follows -
Is this the correct way to handle transforms that aren’t in the root of the project? The log for the deployments seem to indicate that transforms are run for Web.Staging.config, but the other 2 transforms aren’t mentioned.
Thanks for getting in touch! The additional transforms feature recursively searches through the directories, so as long as the transform and it’s target are in the same directory you do not have to define them.
Also no commas needed just line separated.
Just picking up on your reply which raises a related question.
We have an MVC website with areas. Within each area there are web.config files.
At the root level we have one transformation config file per deployment environment.
We only want the transformation to take place at the root level so as to only apply to the web.config at the root level. Is this achievable?
(I would raise another ticket for this question, but it appears that is not possible at the moment).
Thanks for reaching out. If you only want specific config transforms to take place during your deployment, declare them on the “Additional Transforms” field like this:
MyTransformFile.config => Web.config
This will only transform the web.config on the root of the package. Make sure to uncheck the box “Automatically run configuration transformation files”
Hi, I have a related question about: “additional transforms feature recursively searches through the directories, so as long as the transform and it’s target are in the same directory you do not have to define them.” I have several configs files with the same name under different folders and I do not want all of them to be applied. Can I specify them separately ?
Web.#{Octopus.Environment.Name}.config => Web.config
folderA\AppSettings.#{Octopus.Environment.Name}.config => Web.config
folderB\AppSettings.#{Octopus.Environment.Name}.config => Web.config
Hi Priyanka - That should work, yeah. In your case the best would be to uncheck the box “Automatically run configuration transformation files” and add a line for each transformation that you want during your deployment.
Make sure to update to the latest version (3.2.15 right now) where we fixed a bunch of issues related to config transforms and sub-directories.