title: Why are some Web.config transforms tokenised into SetParameters.xml and others are not?
body: <p>I've been using config transforms in VS2010 quite a bit lately but am confused as to why some transforms are applied directly to the Web.config in the package but others are stored against a token in SetParameters.xml then applied on publish.</p>
  
  <p>For example, take a Web.config with the following connection string and app setting:</p>
  
  <pre><code>&lt;connectionStrings&gt;
    &lt;add name="AutoDeployDb" connectionString="Data Source=(local);Initial Catalog=AutoDeploy;User ID=AutoDeployUser;Password=Passw0rd"/&gt;
  &lt;/connectionStrings&gt;
  &lt;appSettings&gt;
    &lt;add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" /&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>Then here's the corresponding config transform for the current build configuration:</p>
  
  <pre><code>&lt;connectionStrings&gt;
    &lt;add xdt:Transform="Replace" xdt:Locator="Match(name)" name="AutoDeployDb" connectionString="Data Source=MyDevServer;Initial Catalog=AutoDeploy;User ID=AutoDeployUser;Password=s*#@Kdsl" /&gt;
  &lt;/connectionStrings&gt;
  &lt;appSettings&gt;
    &lt;add xdt:Transform="Replace" xdt:Locator="Match(key)" key="ChartImageHandler" value="storage=file;timeout=20;dir=d:\inetpub\AutoDeploy\TempImageFiles\"/&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>These are both "Replace" transforms and other than one being a connection string matching on "name" and the other being an app settings matching on "key", to my eye they're identical.</p>
  
  <p>Now look inside the SetParameters.xml file in the resultant package and only the connection string has a setParameter node. In the Web.config of the PackagTmp folder, the app setting transform has already been applied while the connection string has a "$(ReplacableToken_AutoDeployDb-Web.config Connection String_0)" value which is applied only when the package is deployed.</p>
  
  <p>Why is this? Is it something specific to connection strings (or conversely, to app settings)? I appreciate the <a href="http://msdn.microsoft.com/en-us/library/ff398068.aspx" rel="noreferrer">rationale of this approach</a>, I'm just not clear on why it's applied to some settings and not others.</p>
  
  <p>Can anyone shed some light on this?</p>