Was interpreted as an XML configuration transform; variable substitution won't be attempted

I have activated both configuration transform and variable substitution on my project.

On the logs (verbose), I get:
File ‘C:\Octopus\Applications\staging\MyProject\20210329.18731_2\log4net.Release.config’ was interpreted as an XML configuration transform; variable substitution won’t be attempted.

Any reason why I can’t first substitute variable on log4net.Release.config, then run default XML transforms to merge with log4net.config?

We do very similar operations on other projects without issue, and I can’t get what I’m doing wrong here.
Thanks for your ideas.

Hi @gbe,

Thank you for contacting Octopus Support.

Could you tell me what version of Octopus Server you are running? Also, would it be possible for you to share more specific information about this project so that I may attempt to recreate this in a test environment?

Let me know at your earliest convenience.

Regards,

hi @donny.bell ,
I’m running Octopus 2020.1.15

I have created a simplified version and bundled the nupkg, and an export of the variables and steps.
They can be downloaded from: http://dl.free.fr/jXtRpY5mC

In short:

  1. I created a “DEPLOY A PACKAGE” step, and enabled features:
  • Custom Installation Directory
  • JSON Configuration Variables
  • Configuration Variables
  • Configuration Transforsm
  • SubstituteVariable in files, and fill “log4net.Release.config” as the target file
  1. I package a nupgk which contains a log4net.config and log4net.Release.config . The log4net.Release.config contains the line:
    … smtpHost value="#{​​SMTP_Host}​​" xdt:Transform=“Replace” …

  2. I created a variable SMTP_Host with value 123

I’m expecting the variable SMTP_Host to be replaced in the log4net.Release.config, this is not the case.
Let me know if I can assist further to ease reproducing the issue.
Regards,
Gilles

@donny.bell ,
I found the cause of the non replacement. I got some non visible characters that made the variable incorrect.
See the red dots.

By fixing it, I was able to fulfill my needs.

I still have the message (in verbose), even if this works:
File ‘C:\Octopus\Applications\staging…\log4net.Release.config’ was interpreted as an XML configuration transform; variable substitution won’t be attempted.

I would have prefer:

  1. Not to have this message
  2. Have instead the information that no variable was found in the file which was explicitely declared.

Anyway, nothing blocking anymore.

1 Like

Hi @gbe,

Thank you for getting back to me. I’m glad to hear you were able to discover the non-visible characters. I’ve definitely been bitten by that in the past.

I have noted your preferences for the log output.

Let me know if you have any additional questions.

Regards,
Donny

Thanks @donny.bell , that’s good enough for me.
You can close this ticket.

1 Like

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