title: My web.config transform doesn't work
body: <p>I'm using a web.config transform to change a link in the production environment but when previewing it, the transformation doesn't happen.. </p>
  
  <p>Here is my code:</p>
  
  <p>web.Test.config</p>
  
  <pre><code>  &lt;configuration&gt;
      &lt;appSettings&gt;
        &lt;add key ="ELeg" value ="1"/&gt;
      &lt;/appSettings&gt;
    &lt;/configuration&gt;
    &lt;system.web&gt;
  </code></pre>
  
  <p>web.Prod.config</p>
  
  <pre><code>  &lt;configuration&gt;
      &lt;appSettings&gt;
        &lt;add key ="ELeg" value="10" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/&gt;
      &lt;/appSettings&gt;
    &lt;/configuration&gt;
  </code></pre>
  
  <p>When previewing it on the prod and test envoirment, it doesnt add the appSetting.  </p>
  
  <p>Does anyone know what the problem is?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Here is my entire Test transform:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 --&gt;
  
  &lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt;
    &lt;!--
      In the example below, the "SetAttributes" transform will change the value of 
      "connectionString" to use "ReleaseSQLServer" only when the "Match" locator 
      finds an attribute "name" that has a value of "MyDB".
  
      &lt;connectionStrings&gt;
        &lt;add name="MyDB" 
          connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" 
          xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt;
      &lt;/connectionStrings&gt;
    --&gt;
  
    &lt;configuration&gt;
      &lt;appSettings&gt;
        &lt;add key ="ELeg" value ="1" xdt:Transform="Insert" /&gt;
      &lt;/appSettings&gt;
    &lt;/configuration&gt;
    &lt;system.web&gt;
      &lt;compilation xdt:Transform="RemoveAttributes(debug)" /&gt;
      &lt;!--
        In the example below, the "Replace" transform will replace the entire 
        &lt;customErrors&gt; section of your web.config file.
        Note that because there is only one customErrors section under the 
        &lt;system.web&gt; node, there is no need to use the "xdt:Locator" attribute.
  
        &lt;customErrors defaultRedirect="GenericError.htm"
          mode="RemoteOnly" xdt:Transform="Replace"&gt;
          &lt;error statusCode="500" redirect="InternalError.htm"/&gt;
        &lt;/customErrors&gt;
      --&gt;
    &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>