I have xml tranformations on a deploy step. The transformation has a conditional transformation using a Condition which changes the name of an element if it has an old name.
<add name="Database" xdt:Locator="Condition(@name='OldDatabase')" xdt:Transform="SetAttributes(name)" />
This works well if the old name is present, but if not, the transformation issues a warning.
File …web.config.install.xdt, line 16, position 6:
No element in the source document matches ‘/configuration/connectionStrings/add[@name=‘OldDatabase’]’
This is ok but the strange thing is that when all other transformations for the file has been processed, this warning is elevated to an error.
The XML configuration file …web.config failed with transformation file …web.config.install.xdt.
Could not transform the file ‘…web.config’ using the pattern ‘…web.config.install.xdt’.
…web.config.install.xdt(16,6): No element in the source document matches '/configuration/connectionStrings/add[@name=‘OldDatabase’]'
Running rollback conventions…
Why is it behaving like this? Why elevate a warning? Is there some way to not elevate warnings to errors?
I read that I could supress errors by setting the Octopus.Action.Package.IgnoreConfigTransformationErrors variable to true but I would like to fail on errors, but not on warnings…
Using Octopus 3.7.7