Added new transform files and they are not being packaged

Yes Build Action is set to Content :slight_smile:

We have added a new production environment to our pipeline and added a transform for this environment. We added the new configuration, and config file (web.production-eu.config) and set that file’s build action to content. When the build server runs the new transform file is not being added to the the nuget package created by octo pack. I am hoping you can suggest some items for me to look at.

TFS 2013
VS 2013
Octopus 3.4.7


Thanks for getting in touch! For configuration files they need to be set to copy to the output directory as shown towards the bottom of this page:
Could you confirm that is the case? Generally Build Action should be set to none for those types of files.

Let me know if that helps?

I was wondering about that setting, though it isn’t set for any of the working transform files. I will need to try it in the morning.


I am up and about, sent from my phone

On Oct 6, 2016, at 00:20, Vanessa Love <> wrote:

Now that I am awake and re-reading this I am more confused. There are other threads in this forum which state that the Build Action should be set to content, and this is how we have run Octopus Deploy for the last year. (Please see attached image). So what you are saying is that the transform files should be set as:
Build Action: None
Copy to Output Directory: Copy if newer (or always)

Am I understanding this correctly? I would just like to get these new transforms added and move on with this project :slight_smile:


I have tried the setting as you recommended, Build Action: none and Copy to Output Directory: always, and the transform files are still not being included in the package. Any other suggestion you have for me to look at?

For none web projects (windows services etc) The contents of the “bin” directory is all that is packages, so the reverse is the case (Build Action = None, Copy to Output Directory = Always).

For web projects Build Action = Content, and Copy to Output Directory = Do not copy is fine.

If you have definitely opened up the nuget package and the .config file is not there then I’m very confused as well. I assume you don’t have a custom nuspec file?

What happens if you use VS to publish the web site to a directory, it should include the files then as well (this is what Build Action = Content does for a web project).

@sam, that is a great explanation to things. I wonder if that could be spelled out in the documentation under packaging?

My issue, of course, was user error, of course! The dev team setup a new branch and there ended up being two branches with the same name, and of course I was working in the wrong branch. Some day I’ll learn to pay closer attention to build definition repo paths.

Thank you very much for your time and it wasn’t all a waste as your description Sam is most useful, especially for newer users.

Hi @Sam - Thanks a lot for taking the time to explain that! I saw that our documentation had a screenshot that showed the build action as “none” instead of “content” which was very misleading.

I’ve updated our documentation saying it should be:

  • Build Action -> Content
  • Copy to Output Directory -> Copy always

This way It’ll cover both Web and Service projects.

@bslask - Do let me know if you still encounter any issues.



I think it should be mentioned like Sam explained for app vs. web as the end location of the transform matters and will make it clear to the reader.

Yeah, technically setting to Copy Always in a Web project will copy the file into the “bin” directory, which is not what you want.

I’ve added a task in our “documentation to-do list” to improve docs around this subject. I even added a straight link to Sam’s reply to use it as inspiration.