Web config file transformations not working

Hey all,

Basically I am in the process of making Web.Development.config => Web.config transformations without success and the logs act like everything was all right but it basically keeps my old web.config with zero transformations. Not even the release version being copied over. Here is the process log:

Deploying package ‘C:\Octopus\Files\WebBookingToolApi.1.0.18.353.nupkg-f1ae6d76-47f5-4314-a967-297c546daad1’ to machine ‘https://:10933/’
15:07:31Info
Deploying package: C:\Octopus\Files\WebBookingToolApi.1.0.18.353.nupkg-f1ae6d76-47f5-4314-a967-297c546daad1
15:07:34Info
Transforming ‘C:\Octopus\Applications\Development\WebBookingToolApi\1.0.18.353\Web.config’ using ‘C:\Octopus\Applications\Development\WebBookingToolApi\1.0.18.353\Web.Development.config’.
15:07:34Info
Transforming ‘C:\Octopus\Applications\Development\WebBookingToolApi\1.0.18.353\Web.config’ using ‘C:\Octopus\Applications\Development\WebBookingToolApi\1.0.18.353\Web.Release.config’.
15:07:34Info
Copying package contents to '\
\Websites\WebBookingToolApi’
15:07:39Info
Copied 240 files

And my process configuration, config files and my nuget package looks like in the attachment. I have manually downloaded the both config files from the package and they are different, however octopus doesn’t make the appsettings change.

Please help me in the right direction how to make this work.
Thanks a lot,
Regards
Cenk

webconfig.PNG

nupkg.PNG

Hi Cenk,

My suggestion would be to have a look to Octopus Deploy Docs for “Configuration Transforms”

http://docs.octopusdeploy.com/display/OD/Configuration+files#Configurationfiles-ConfigurationTransformationConfigurationtransforms

Basically, you need to use Web.config Transformation Syntax for Web Project Deployment Using Visual Studio.

http://msdn.microsoft.com/en-us/library/dd465326.aspx

So, assuming that you would like to update the value of DiscoveryProbeEndPointAddress to another value, your webdev.config file should only include

Just have a look to MSDN page and you will find good samples. Basically you don’t need to set all appsettings, connectionstring values on webdev.config, only the ones that will change via Configuration Transform.

Adding the missing part

<?xml version="1.0"?>

Hi @Cenk,

Like @Melih mentioned, you are missing the Config Transform syntax in your WebDevConfig. It should have lines like xdt:Transform="Replace" and xdt:Locator="Match(key)" to actually implement changes in your Web.config.

Along with the links that @Melih provided, you can check this one where it shows how the web.config and web.transform.config files should look, and the results after the transformation

https://webconfigtransformationtester.apphb.com/

Thanks,
Dalmiro

Thanks a lot. That sorted my issue and that tester app is so useful Dalmiro, saved me a lot of time. You are a star guys…

Glad to hear that @Cenk! That tester must get a thousand visits from my laptop alone every year :slight_smile:

Cheers