title: Visual Studio 2012 Web Deploy Publish ignores selected Configuration for transform and build
body: <p>When I create a publish profile I have the option to select which Configuration I want the publish to use for this profile. The options are like Debug, Release or any custom defined one like Staging. 
  The problem is that if I select any Configuration other than Release or Debug, say Staging, visual studio totally ignores my selection and uses Web.Release.config for transform and build.
  Am I doing something wrong or is this by design? It seems that Publish only recognizes Release and Debug as acceptable Configuration. Any thoughts on this issue?</p>
  
  <p>I am using Visual Studio 2012 RTM. </p>
  
  <p><strong>Update 1 :: "NightlyLive - Any CPU" configuration selected:</strong></p>
  
  <p>Here I select my own custom Configuration "NightlyLive":</p>
  
  <p><img src="https://i.stack.imgur.com/tlGpv.png" alt="enter image description here"></p>
  
  <p>And here is what happens when I publish:</p>
  
  <pre><code>6&gt;------ Build started: Project: UI.Next, Configuration: Release Any CPU ------
  7&gt;------ Publish started: Project: UI.Next, Configuration: Release Any CPU ------
  7&gt;Transformed Web.config using [...]\UI.Next\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
  </code></pre>
  
  <p>As you can see it builds the project using Release Any CPU (instead of NightlyLive - Any CPU) and also it transforms the Web.config using Web.Release.config (instead of Web.NightlyLive.config).</p>
  
  <p><strong>Update 2 :: Profile name renamed to "NightlyLive":</strong></p>
  
  <p>Here i rename the profile name from "test" to "NightlyLive". </p>
  
  <p><img src="https://i.stack.imgur.com/denan.png" alt="enter image description here"></p>
  
  <p>Here is the console output:</p>
  
  <pre><code>6&gt;------ Build started: Project: UI.Next, Configuration: Release Any CPU ------
  7&gt;------ Publish started: Project: UI.Next, Configuration: Release Any CPU ------
  7&gt;Transformed Web.config using [...]\UI.Next\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
  7&gt;[...]\UI.Next\Web.NightlyLive.config(23,18): Warning : Argument 'debug' did not match any attributes
  7&gt;[...]\UI.Next\obj\Release\TransformWebConfig\transformed\Web.config(78,6): Warning : No attributes found to remove
  7&gt;Transformed obj\Release\TransformWebConfig\transformed\Web.config using [...]\UI.Next\\Web.NightlyLive.config into obj\Release\ProfileTransformWebConfig\transformed\Web.config.
  </code></pre>
  
  <p>So here, still it is building using Release Any CPU. </p>
  
  <p>But for Web.config it first transforms using Web.Release.config then it does a second transformation on top of the previous one using Web.NightlyLive.config.</p>
  
  <p>The double transformation i think is by design and makes sense. But the fact that you have to rename your profile name to the configuration name to force use your custom transformation file, does not look right.</p>
  
  <p><strong>Update 3 :: TestSolution added</strong></p>
  
  <p>You can download the stripped down solution from <a href="http://sdrv.ms/OSJNcS" rel="noreferrer">here</a>.</p>
  
  <p>First I created a brand new vs2012 solution and everything worked fine. So I decided to strip down my current solution and upload as test case. </p>
  
  <p><em>Please note that my solution was originally a vs2010 solution that i opened in vs2012 and vs2012 did the necessary modifications to the solution.</em> </p>
  
  <p><strong>Update 4 :: Verdict</strong></p>
  
  <p>I guess my solution configurations were all messed up. So basically to solve this issue, I deleted all my customized solution and project configurations and created them again along with the web.config transform files.</p>
  
  <p><strong>Problem solved.</strong></p>