2

I have a web project with a config transform.

On my local machine, when the project is built, the transform works fine.

However, my project is pushed to TFS and built there, the config file is transformed in the main drop folder; However, the version in _PublishedWebsites is the original, un-transformed version.

This is causing problems when using Octopack, since it packs everything in the _PublishedWebsites\ folder to deploy, thus, I'm getting an un-transformed file in my deployment

Is there a way to make TFS transform the config file before pushing to _PublishedWebsites

Edit
We're using TFS 2012

Alex
  • 37,502
  • 51
  • 204
  • 332
  • What version of VS is installed on the build server? – Pero P. Mar 05 '15 at 19:51
  • sorry, should have included that - it's TFS 2012 – Alex Mar 05 '15 at 20:23
  • But which version of Visual Studio? – MrHinsh - Martin Hinshelwood Mar 06 '15 at 13:35
  • Why do you care about have a transformed web.config. Use you deployment tool to manage the web.config based on the environment you are deploying on. If you are using web.config, then you need one for each target and you then need to manage copying of the right one. Most modern deployment tool will give you the opportunity to replace token in web.config, or change web.config node values. – Etienne Mar 09 '15 at 14:22
  • My 'web.config' contains the default values, used in debug within visual studio. 'localhost' server connections. My web.release.config contains transforms to set the values to #{VariableName} - octopus should then replace these tokens – Alex Mar 09 '15 at 14:39

1 Answers1

7

Based on info I found on these articles:

The solution was to add

/p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false

To my build arguments.

Now, the transformed Web.Config file is copied to _PublishedWebsites

Alex
  • 37,502
  • 51
  • 204
  • 332
  • FYI - I'm not sure if you know that you can bundle all your transformations in your NuGet package and have Octopus run the transformation per environment. This way you don't have to target a specific environment in your build. – osij2is Apr 09 '15 at 16:38