Web.*.config transformations not working correctly


I’m trying to get Web.*.config transforms to work, but it seems like I can’t.

This is the setup:

Environmentname #1: Server Test
Environmentname #2: Server Production

I tried to follow this article: http://docs.octopusdeploy.com/display/OD/Configuration+files.
It doesn’t look like this works for me.

Problem is:
In Visual Studio I have two different solution configurations:

#1: Test
#2: Release

I use the main Web.config for development purposes.

Now when I deploy the application to «Server Test», Octopus will run the Web.Release.config instead of Web.Test.config. Why is this? I thought by convention it used Test as the environment is named something that contains «Test»?

Thanks in advance.

// Anders

Hi Anders,

Web.Release.config will always be run, regardless of the environment. For an environment specific transform to run as well, it needs to be named exactly as the environment is named, so Web.Server Test.config sounds like it would be the right one for your scenario.

Hope this helps,

Hi Nick,

Thank you so much for your help. I will try this and come back to when I’ve tested what you suggested.

// Anders

Hi again,

After some tweaking I got it working!

Nicholas was right. The Environment name need to be named exactly the same as the Web.*.config.

More things to remember:

  • If you add new Solution Configurations in Visual Studio. Remember to set their Build Action to Content.
  • Remember to enable the feature: Configuration transforms (version 2.0+ (?)) as seen in the attached image.

Thanks for your prompt response to this matter, Nicholas.

// Anders