4

I am trying to publish in VS 2012 using a build configuration called "CI" but when I execute the publish, the "Release" transform (web.Release.config) is used on web.config. How do I get web.CI.config to be applied instead? I thought this would be automatic.

I have conducted a few experiments which confirm this.

Has anyone seen this? Is this a (fixed) bug?

1
  • 4 years later (using VS 2015) and still encountered this problem. The accepted answer worked for me. Commented Nov 12, 2018 at 17:23

1 Answer 1

5

Sometimes configurations get messed up depending on how you added the configuration. To fix this, close visual studio, open your solution(.sln) file in an text editor. Under GlobalSection(ProjectConfigurationPlatforms) = postSolution section you might see something like this

{427E2FA3-1BAE-4A03-A712-C951ECEC45A3}.CI|Any CPU.ActiveCfg = Release|Any CPU {427E2FA3-1BAE-4A03-A712-C951ECEC45A3}.CI|Any CPU.Build.0 = Release|Any CPU

Notice that CI is equating to Release. Change the above to

{427E2FA3-1BAE-4A03-A712-C951ECEC45A3}.CI|Any CPU.ActiveCfg = CI|Any CPU {427E2FA3-1BAE-4A03-A712-C951ECEC45A3}.CI|Any CPU.Build.0 = CI|Any CPU

Reload solution in visual studio and try publishing again.

Sign up to request clarification or add additional context in comments.

3 Comments

Absolutely the correct answer. However, I found a bunch of these mistakes (of the same pattern) and had to make sure I fixed all of them. Do you know if this problem survived into VS 2013 or was it fixed?
This happens in all visual studios. When you create a new configuration you get an option "Copy setting from" we usually end up choosing one of the existing configurations. That's when we get these weird setting in the sln file. I think if we choose the create empty option, this problem does not occur.
Thanks for the heads up. This is so typical Microsoft, it makes my head spin. I had to use the configuration manager to explicitly create a "Stage" configuration so that my web.stage.config is actually used during publish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.