Config transforms not running per environment and not applied

We have four environments: Testing, Staging, Single Instance (production) and Disaster Recovery.
I have created a config transform file for each environment as I need to update a web service reference for each environment. Two problems have transpired:

  1. All transforms seem to be accessed for each environment. I’d expect to see only web.testing.config access in the Testing deployment, but the logs show all the configs accessed on each envirnment. Is this correct?

  2. Despite the transform files being accessed and noted in the logs, none of the actual transformations are being applied. It always states “No matching appSetting, applicationSetting, nor connectionString names were found” for each transform file.

One of the transforms files:

<?xml version="1.0" encoding="utf-8"?>

Snippet of part of the web.config to be transformed:

<?xml version="1.0" encoding="utf-8"?> ... ...

Output of the first environment named Testing:

Updating appSettings, applicationSettings, and connectionStrings in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\CAPSMain.dll.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\FrontierData.dll.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\FrontierDataWarehouseGenAccess.dll.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\PrepaidGenAccess.dll.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\ProcessorSettingsServicePlugIn.dll.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\Web.Disaster Recovery.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\Web.Single Instance.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\Web.Staging.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\Web.Testing.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\roslyn\csc.exe.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\roslyn\vbc.exe.config

October 29th 2020 13:33:47

Info

No matching appSetting, applicationSetting, nor connectionString names were found in: E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331\bin\roslyn\VBCSCompiler.exe.config

October 29th 2020 13:33:49

Info

Making sure a Web Application “IdealPortal” is configured as a child of “Default Web Site” at “E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331”…

October 29th 2020 13:33:50

Info

Application pool “IdealPortal2” already exists

October 29th 2020 13:33:50

Info

Set application pool identity: ApplicationPoolIdentity

October 29th 2020 13:33:51

Info

Set .NET framework version: v4.0

October 29th 2020 13:33:52

Info

Web Application “IdealPortal” already exists, no need to create it.

October 29th 2020 13:33:52

Info

Setting physical path of IIS:\Sites\Default Web Site\IdealPortal to E:\Octopus Tentacle\Applications\Testing\IdealPortalWebV2\2020.10.29.133331

October 29th 2020 13:33:52

Info

Assigning “IIS:\Sites\Default Web Site\IdealPortal” to application pool “IdealPortal2”…

October 29th 2020 13:33:54

Info

IIS configuration complete

Hi Neville,

Thank you for your configuration query.

There are two very similar features in Octopus Deploy - one called Configuration Variables and one called Configuration Transforms. Your sample XML doesn’t appear to be attached, but from your description it sounds like you are looking to use Configuration Transforms but the log suggests that you are using Configuration Variables instead. That would explain the unusual behaviour you are seeing.

Can you please take a look at the articles above and confirm if that is the case? If so, can you please try switching to the other option and letting me know if that helps?

Best Regards,

Charles

Hi Charles, we are familiar with both options and most of our processes, including this one uses both config transforms and config variables. Those all work. Something odd about this one. Please tell me what I can share with you to help problem solve this further.

Hi Neville,

Thank you for your message.

You mentioned that the transformations appear to be applying to all environments, and not just to the one you are deploying to. This could be caused by the name of your transform files. In order to target a specific environment Octopus Deploy would be expecting *.<EnvironmentName>.config. However, if you happen to be using *.Release.config that would apply to every deployment.

Would you be able to provide the names of your transform files, an example of a transform file, a full deployment log and a screenshot of how you have configured the transform step (or, if possible, an export of your process JSON for us)? Please use file attachments rather than including them inline to ensure formatting is preserved. If any of the files are sensitive please let me know beforehand and I’ll be able to make the topic private.

Best Regards,

Charles

Eventually I manged to solve this myself. Turns out the transformation was not running because Octopus could not find the transform files. MSBuild puts them into the bin folder by default which is one level lower than the target web.config. Our other processes have functioning transforms as they use custom named files and explicit transform paths specified, not the built-in *..config convention.
To get MSBuild to not publish the transform files to the bin folder, I had to edit the project file and remove the Web.config node for each of the transformation files. Also set the file properties in Visual Studio to “Content”.

Hi Neville,

Thank you for the update. I’m pleased to hear that you’ve managed to solve this and appreciate you sharing your solution for future reference.

Please get back to us if you have any questions.

Best Regards,

Charles

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.