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.
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?
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:
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
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” …
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
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:
Not to have this message
Have instead the information that no variable was found in the file which was explicitely declared.
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.