Issue with "Configuration transforms" and "Substitute variables in files"

Hi!
I have issue with configuration transformation with my .net application. I have LoggingConfiguration.config which is used in development and placed in folder Configuration. Part of that file is:

 <listeners>
    <add name="Exception" 
      fileName="c:\hpexceptions\exceptionsDefault.log" 
      rollSizeKB="1024" timeStampPattern="MM-dd-yyyy" traceOutputOptions="Callstack" />
  </listeners>

I want fileName to change depending on environment.
My environment is called “Continuous Integration”.

So, I created LoggingConfiguration.Release.config with a content:

<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations 
     see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<loggingConfiguration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <listeners>
    <add name="Exception"
      fileName="#{LogFileUrl}" 
      rollSizeKB="1024" timeStampPattern="MM-dd-yyyy" traceOutputOptions="Callstack"
      xdt:Transform="Replace" xdt:Locator="Match(name)"
      />
  </listeners>
</loggingConfiguration>

I want fileName to have value from variable list like shown below in images.
What am I doing wrong?

How can I keep initial file path for development (Git) *fileName=“c:\hpexceptions\exceptionsDefault.log” *
And replace the value in same config file and use another path configured in Variables?

Thank you!

12345.png

Hi Tijana,

Thanks for getting in touch! Your screenshots, and sample code look correct. Could you provide a deployment log where it is not working?


Which version of Octopus are you running?

Thanks!
Vanessa