Issue running configuration transforms

I followed the instructions listed here for running my Web.Release.config transforms when I deploy. The screenshot near the bottom of the page shows marking a config file as ‘Copy if newer’ but the build action is ‘None’. I’ve found that I can only get this to work if the build action is set as ‘Content’ otherwise the Web.Release.config isn’t included in my nuget package. Am I missing a step or should the file me marked as ‘Content’? If is should be content then it leaves an annoying Web.Release.Config file on the destination server as well as the transformed web.config. It would be nice if it cleaned up the transform file automatically. Yea,h I know I could write a powershell script to do that but it would be nice if it did it for me. :slight_smile:


Hello Pete,

I’m also setting the config files to “Content” in order to include them in the nuget package, and using a PostDeploy script to clean up the mess. While I agree that it would be nice to have Octopus take care of this automatically, here’s my one-liner that takes care of it right now:

rm *.config -Exclude web.config

Hi Pete and Eric,

Thanks for getting in touch! Dreaded words coming: it is by design we leave these files.
However you do not need to run your own PowerShell - we do have a library Step Template for this purpose:!/step-template/actiontemplate-file-system-clean-directory

Hope that helps!