Web config transformation not working for environments other that release

Octopus version 3.4.12

I am having an issue where the development transformation for the Development environment does not work. I have tried 2 different things. I created a transform called Web.Development.config and I tried to use it by putting a value in the Additional Transforms field (see attached) and by leaving the field blank and allowing the system find it. Neither works. I either end up with the base config values or the Release values.

The nodes in the Development config are below:

Below is the complete log for the build. There are no errors.

Guided failure is not enabled for this task
December 5th 2016 10:58:21
Info
The deployment completed successfully.
Acquire packages
December 5th 2016 10:58:11
Info
Acquiring packages
December 5th 2016 10:58:11
Info
Making a list of packages to download
December 5th 2016 10:58:11
Verbose
No packages are required on the Octopus Server
December 5th 2016 10:58:11
Info
Delta compression is enabled for package transfers from the Octopus Server to deployment targets
December 5th 2016 10:58:11
Verbose
Acquire Terminations.44.0.0 on cretewebt
December 5th 2016 10:58:11
Verbose
Checking package cache for package Terminations version 44.0.0
December 5th 2016 10:58:11
Verbose
Package Terminations version 44.0.0 was found in cache. No need to download. Using file: D:\Octopus\OctopusServer\PackageCache\feeds-team-city-feed\Terminations.44.0.0_05AC783E19CF9E48A8416E5BAA3A895A.nupkg
December 5th 2016 10:58:11
Verbose
SHA1 hash of package Terminations is: 025c27425d558331964159d3ca2e8aa935e5ff1f
December 5th 2016 10:58:13
Info
All packages have been acquired
December 5th 2016 10:58:13
Verbose
Acquire Packages completed
cretewebt
Upload package Terminations version 44.0.0
December 5th 2016 10:58:12
Verbose
Octopus Deploy: Calamari version 3.4.28+Branch.master.Sha.96a69790296f77ad4790453c358e201267f82977
December 5th 2016 10:58:12
Verbose
Name Value
December 5th 2016 10:58:12
Verbose


December 5th 2016 10:58:12
Verbose
CLRVersion 2.0.50727.5485
December 5th 2016 10:58:12
Verbose
BuildVersion 6.1.7601.17514
December 5th 2016 10:58:12
Verbose
PSVersion 2.0
December 5th 2016 10:58:12
Verbose
WSManStackVersion 2.0
December 5th 2016 10:58:12
Verbose
PSCompatibleVersions {1.0, 2.0}
December 5th 2016 10:58:12
Verbose
SerializationVersion 1.1.0.1
December 5th 2016 10:58:12
Verbose
PSRemotingProtocolVersion 2.1
December 5th 2016 10:58:13
Verbose
Octopus Deploy: Calamari version 3.4.28+Branch.master.Sha.96a69790296f77ad4790453c358e201267f82977
December 5th 2016 10:58:13
Verbose
Package Terminations 44.0.0 hash 025c27425d558331964159d3ca2e8aa935e5ff1f has already been uploaded
December 5th 2016 10:58:13
Info
Package Terminations.44.0.0 (5.88 MB) found in cache. No need to upload. Using C:\Octopus\Files\Terminations.44.0.0.nupkg-e9c96c11-dcb8-4d08-9e01-37d2cf3910fe
Step 1: Deploy to Test
December 5th 2016 10:58:20
Verbose
Deploy to Test completed
cretewebt
83 additional lines not shown
December 5th 2016 10:58:15
Verbose
BuildVersion 6.1.7601.17514
December 5th 2016 10:58:15
Verbose
PSVersion 2.0
December 5th 2016 10:58:15
Verbose
WSManStackVersion 2.0
December 5th 2016 10:58:15
Verbose
PSCompatibleVersions {1.0, 2.0}
December 5th 2016 10:58:15
Verbose
SerializationVersion 1.1.0.1
December 5th 2016 10:58:15
Verbose
PSRemotingProtocolVersion 2.1
December 5th 2016 10:58:15
Info
Creating Web Application /Terminations …
December 5th 2016 10:58:16
Verbose
Searching for Default Web Site Web Site.
December 5th 2016 10:58:16
Verbose
Loading Application pool
December 5th 2016 10:58:16
Info
Application pool “DefaultAppPool” already exists
December 5th 2016 10:58:16
Info
Set application pool identity: SpecificUser
December 5th 2016 10:58:17
Info
Set .NET framework version: v4.0
December 5th 2016 10:58:18
Info
Web Application “/Terminations” already exists.
December 5th 2016 10:58:18
Info
Setting physical path of IIS:\Sites\Default Web Site\Terminations to C:\inetpub\wwwroot\Development\Terminations\44.0.0_1
December 5th 2016 10:58:18
Verbose
Loading Site
December 5th 2016 10:58:18
Info
Assigning “IIS:\Sites\Default Web Site\Terminations” to application pool “DefaultAppPool”…
December 5th 2016 10:58:20
Info
IIS configuration complete
December 5th 2016 10:58:20
Verbose
Deleting ‘C:\inetpub\wwwroot\Development\Terminations\44.0.0_1\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’
December 5th 2016 10:58:20
Verbose
Adding journal entry:
December 5th 2016 10:58:20
Verbose

Apply retention policy on Tentacles
December 5th 2016 10:58:21
Info
Apply retention policies…
December 5th 2016 10:58:21
Verbose
Tentacle retention policy set to ‘keep all’
December 5th 2016 10:58:21
Verbose
Apply Tentacle Retention Policy completed

Until the issue is resolved I am working around this by using variables, but that kind of defeats the purpose of having config files that automatically make those changes.

Thanks in advance for your help

Hi Greg,

Is your transform file (Web.Development.config) in the same directory as your source config (Web.config)? Neither of those methods will work if it is not.

In case you haven’t seen it, this page gives many examples for configuring transforms.

Also, in later Octopus versions we have improved the logging when configuration transforms are not applied (i.e. don’t match).

I hope this helps. Please let us know if you are still having troubles.

Regards,
Michael

Yes, the transforms are in the same directory. The odd thing is that it will pick up the Release transform without any problems. I assume that is because it is the default.

I upgraded to the latest version. Still no luck. There is nothing in the logs telling me anything about the transforms.
Our system is set up to use packages created by Team City. I notice that in one of our projects, which is an MVC web application, Octo copies all of the config transforms into the directory on our web server. In that project, all of the config transforms work as expected. Octo is only copying the base web.config file in other projects, which are wcf services. In these projects the configuration transforms don’t work, even though team city is still providing all of the transforms. Any idea why Octo wouldn’t be picking up the transforms?

Since you are now on the latest version, you can create a Octopus.Action.Package.EnableDiagnosticsConfigTransformationLogging variable in your project and set it’s value to True. This will enable some super-verbose logging.

When you say Octopus copies the transforms… are you certain the transforms are being included in the package? Is it possible that in your solution you don’t have them set to copy to output? At deploy time, Octopus simply extracts the entire package, and looks for the transforms within the extracted package.

In looking at the team city server, all of the transform are in the folder that team city copies from our Git repository (Attached image). In the octopus server I can find this package (C:\Octopus\Files\ExportService.5.0.0.nupkg-0edfaa45-73ad-4752-a764-f1eaf7f8aa12) but of course I can’t simply view its contents. I don’t find any team city settings dictating whether or not config transforms should be included in the package. Is there a way to view the contents of the package octo receives from team city?

Your last comment got me thinking about whether or not the configs were included in the package and gave me an idea for a Google search. I found the answer in another support discussion (http://help.octopusdeploy.com/discussions/questions/2377-teamcity-not-packing-webconfig). This fixed the problem. Thanks for your help!