How to prevent web.Release.config from being applied during the build?

Octopus has a nice built-in feature that when it finds config transform named as *.Release.config it gets applied automatically. But it kind of contradict to built-in feature of web projects which automatically execute config transform named after current solution configuration, i.e. when building Release solution configuration it also finds and tries to apply web.Release.config!

Release transform intended for Octopus causes trouble for tests as the build does not substitute Octopus variables with some values and as the result we end up with broken config (something like debug=#{debugProperty} which fails validation because bool is expected).

I wonder what scenario or recipe Octopus developers had in mind when decided to auto-apply Release.config transforms? Is there easy way to prevent its application at the build time? I feel that I miss some piece of the puzzle and without it Release.config transform feature becomes a burden rather than being helpful. What am I missing?


Hi Konstantin,

Thanks for getting in touch. I believe the auto-application of *.Release.config was designed for non-web apps (eg WPF), where the build does not automatically apply those transforms.

If you want to disable the build time application of the transform, see this article.

An alternative is to rename your transform to something like Web.Deploy.config and specify that as an additional transform in your Octopus step.

Robert W

Thank you!