Web.config transform problems

We just started using Octopus together with Jenkins a few weeks ago to deploy our website to our IIS.
To use some visual studio features, we have a web.base.config, and web..config in our project.
Current octopus transform: "Web.#{Octopus.Environment.Name}.config => Web.base.config"
We then in Postbuild.ps1 rename web.base.config to web.config.

The problem is that Postbuild.ps1 is executed after the deploy process has changed the physical path is the website, so for a second, the website is running without a web.config file.

How do I solve this problem in Octopus? I need to transform base.web.config with web..config, but still end up with a new web.config file.

Regards Andreas

Solved it by enable “Custom deployment scripts”, and ran the rename as a deployment script.
“This script will run after XML configuration changes are made, but before any IIS or Windows Service changes are made.”

Maybe I was a little to fast with my post here at the discussion area :wink:

Regards Andreas