Transformations converts tabs to spaces and removes line breaks

We are using the “Configuration transforms” feature when deploying our web application.

Each config can have a transform-file for each environment and machine that we deploy to + default transformations that apply to all environments and machines. We run these transform files using “Additional transforms” with these expressions:

*.Default.config => *.config
*.Environment.#{Octopus.Environment.Name}.config => *.config
*.Machine.#{Octopus.Machine.Name}.config => *.config

This works fine except for the fact that the transformations seems to converts tabs to spaces and removes line breaks in our xml-elements. This makes it a bit hard to compare the transformed files to the originals.

I have checked the format of the files in the nuget-package and they have tabs and line breaks are preserved.
I have also tried running the transforms in Visual studio using the addon Slow Cheetah and tabs and line breaks are preserved.
So the problems seems to occur when the transformations are run during the deployment.

Is this by design in OD or could it be a bug?

Hi Andreas,

Thanks for getting in touch! Octopus does not make any formatting changes.
Could you run your configs through here: https://webconfigtransformationtester.apphb.com/ and see if the formatting also changes?

A copy of a full deployment log might also help here. I am thinking due to the wild card it would be running the same transforms over many files and causing the issue.
http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task

Thanks!
Vanessa

I have tried it now with exemple files from two separate projects and both work fine when previewing transforms in VS using Slow Cheetah or when doing a Publish in VS.

When running the transforms in OD or https://webconfigtransformationtester.apphb.com/ the tabs in the entire file is converted to spaces and the xml-elements that is affected by the transforms looses its line breaks.

Regarding the mutliple transform files as a cause of the issue, I have another application that seem to have the same problem where we just run one transform named after the environment it is being deployed to.

Here is the log for that file transform:
| Success: Apply EPiServer.Default.config
16:03:27 Info | Transforming ‘D:\IIS\webserver\Stage\Project.Name\4.2.0.66\Config\EPiServer.config’.
16:03:27 Verbose | Source file: ‘D:\IIS\webserver\Stage\Project.Name\4.2.0.66\Config\EPiServer.config’.
16:03:27 Verbose | Transform file: ‘D:\IIS\webserver\Stage\Project.Name\4.2.0.66\Config\EPiServer.Default.config’.
16:03:27 Verbose | Executing Replace (transform line 6, 9)
16:03:27 Verbose | on /_defaultNamespace:episerver/_defaultNamespace:sites/_defaultNamespace:site
16:03:27 Verbose | Applying to ‘site’ element (no source line info)
16:03:27 Verbose | Replaced ‘site’ element
16:03:27 Verbose | Done executing Replace
|
| Success: Apply EPiServer.Environment.Stage.config
16:03:27 Info | Transforming ‘D:\IIS\webserver\Stage\Project.Name\4.2.0.66\Config\EPiServer.config’.
16:03:27 Verbose | Source file: ‘D:\IIS\webserver\Stage\Project.Name\4.2.0.66\Config\EPiServer.config’.
16:03:27 Verbose | Transform file: ‘D:\IIS\webserver\Stage\Project.Name\4.2.0.66\Config\EPiServer.Environment.Stage.config’.
16:03:27 Verbose | Executing SetAttributes (transform line 6, 9)
16:03:27 Verbose | on /_defaultNamespace:episerver/_defaultNamespace:sites/_defaultNamespace:site
16:03:27 Verbose | Applying to ‘site’ element (no source line info)
16:03:27 Verbose | Set ‘siteId’ attribute
16:03:27 Verbose | Set 1 attributes
16:03:27 Verbose | Done executing SetAttributes
16:03:27 Verbose | Executing SetAttributes (transform line 7, 18)
16:03:27 Verbose | on /_defaultNamespace:episerver/_defaultNamespace:sites/_defaultNamespace:site/_defaultNamespace:siteSettings
16:03:27 Verbose | Applying to ‘siteSettings’ element (no source line info)
16:03:27 Verbose | Set ‘siteUrl’ attribute
16:03:27 Verbose | Set 1 attributes
16:03:27 Verbose | Done executing SetAttributes

Hi Andreas,

Thanks for testing that and following up. Octopus uses the Microsoft Web XMLTransforms right out of the box. So the formatting happening is by their design I guess, we don’t add to it or change it in anyway. This would be what AppHarbor is also doing, and would be pretty standard.

So not a bug and by design in so far as we don’t interfere.
It is weird that VS and Slow Cheetah aren’t using the standard.

Here is a link for further information about what we use: https://xdt.codeplex.com/

Vanessa