title: MSBuild web.config transforms not working
body: <p>I am setting up my application for CI&amp;D.  I created a DEV-Deploy web.config transform which contains the connection strings for the dev testing environment.</p>
  
  <p><img src="https://i.stack.imgur.com/hcoTA.png" alt="Web config transforms"></p>
  
  <p>Here are the contents of the Web.DEV-Deploy.config connection string section:</p>
  
  <pre><code>  &lt;connectionStrings xdt:Transform="RemoveAttributes(configSource)"&gt;
      &lt;add name="DbContext"
        providerName="MySql.Data.MySqlClient"
        connectionString="CXN_STRING"
        xdt:Transform="Insert" xdt:Locator="Match(name)"/&gt;
      &lt;add name="elmah"
        connectionString="CXN_STRING"
        xdt:Transform="Insert" xdt:Locator="Match(name)"/&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>It should look like:</p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;add name="DbContext" providerName="MySql.Data.MySqlClient"
        connectionString="CXN_STRING"/&gt;
      &lt;add name="elmah" connectionString="CXN_STRING"/&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>I'm building using the command line and I have tried the following commands, neither of which work:</p>
  
  <pre><code>msbuild web\web.csproj /T:Package /P:Configuration=DEV-Deploy /P:TransformConfigFiles=true
  msbuild web\web.csproj /T:Package /P:Configuration=DEV-Deploy /t:TransformWebConfig
  </code></pre>
  
  <p>The deploy task looks like this:</p>
  
  <pre><code>web.deploy.cmd /Y /M:https://MACHINEIP:8172/msdeploy.axd -allowUntrusted /U:USERNAME /P:PASSWORD /A:Basic
  </code></pre>
  
  <p>The web.config looks like this upon deployment:</p>
  
  <pre><code>&lt;connectionStrings configSource="connectionStrings.config"&gt;&lt;/connectionStrings&gt;
  </code></pre>
  
  <p>I have tested to the best of my ability on my local machine and have not been able to duplicate the issue.  What do I need to do to get the transform working correctly on the build?</p>