Tevya
Tevya

Reputation: 864

Why is web deploy not using the correct web.config transform?

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?

Upvotes: 4

Views: 1640

Answers (1)

sunil
sunil

Reputation: 5168

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.

Upvotes: 5

Related Questions