title: Web Deploy parameterization issue
body: <p>I'm running into an issue with one of our Sitecore projects. The problem is that certain parameters won't get replaced... I've reproduced the issue in the GitHub repository shown below.</p>
  
  <p><a href="https://github.com/jopmiddelkamp/Web-Deploy-Parameters-issue" rel="nofollow noreferrer">https://github.com/jopmiddelkamp/Web-Deploy-Parameters-issue</a></p>
  
  <p>With the <code>parameters.xml</code> file below I'm trying to replace mail server values for the Sitecore EXM MAT.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;parameters&gt;
    &lt;parameter name="Mail Server" description="Mail server to enter into config" tags="Hidden,NoStore" defaultValue="__MailServer__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\Sitecore\.Smtp\.config$" match="//sitecore/settings/setting[@name='MailServer']/@value" /&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//sitecore/exm/eds/smtpSettings/server/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="Mail Server User Name" description="Mail Server User Name to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerUserName__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\Sitecore\.Smtp\.config$" match="//sitecore/settings/setting[@name='MailServerUserName']/@value" /&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//sitecore/exm/eds/smtpSettings/userName/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="Mail Server Password" description="Mail Server Password to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerPassword__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\Sitecore\.Smtp\.config$" match="//sitecore/settings/setting[@name='MailServerPassword']/@value" /&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//sitecore/exm/eds/smtpSettings/password/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="Mail Server Port" description="Mail Server Port to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerPort__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\Sitecore\.Smtp\.config$" match="//sitecore/settings/setting[@name='MailServerPort']/@value" /&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//sitecore/exm/eds/smtpSettings/port/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="EXM Mail Server SSL or TLS Enabled" description="EXM Mail Server SSL/TLS enabled to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerSslOrTlsEnabled__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//sitecore/exm/eds/smtpSettings/startTls/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="EXM Mail Server Authentication Method" description="EXM Mail Server Authentication Method to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerAuthenticationMethod__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//sitecore/exm/eds/smtpSettings/authenticationMethod/text()" /&gt;
    &lt;/parameter&gt;
  &lt;/parameters&gt;
  </code></pre>
  
  <p>This generates the <code>SetParameters.xml</code> file as shown below.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;parameters&gt;
    &lt;setParameter name="IIS Web Application Name" value="ParametersTest" /&gt;
    &lt;setParameter name="Mail Server" value="__MailServer__" /&gt;
    &lt;setParameter name="Mail Server User Name" value="__MailServerUserName__" /&gt;
    &lt;setParameter name="Mail Server Password" value="__MailServerPassword__" /&gt;
    &lt;setParameter name="Mail Server Port" value="__MailServerPort__" /&gt;
    &lt;setParameter name="EXM Mail Server SSL or TLS Enabled" value="__MailServerSslOrTlsEnabled__" /&gt;
    &lt;setParameter name="EXM Mail Server Authentication Method" value="__MailServerAuthenticationMethod__" /&gt;
  &lt;/parameters&gt;
  </code></pre>
  
  <p>So far so good! I want the values to be replaced with the <code>__placeholder__</code> structure so our VSTS release proces can replace those values with the right environment variables.</p>
  
  <p>Now the problem is that on deployment the <code>userName</code> and <code>password</code> nodes won't get replaced in the <code>\App_Config\Include\EmailExperience\Sitecore.EDS.Providers.CustomSmtp.config</code> file. The result is shown below.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"&gt;
      &lt;sitecore&gt;
          &lt;exm&gt;
              &lt;eds&gt;
                  ...
                  &lt;smtpSettings type="Sitecore.EDS.Core.Net.Smtp.SmtpSettings, Sitecore.EDS.Core" singleInstance="true"&gt;
                      &lt;server&gt;__MailServer__&lt;/server&gt;
                      &lt;port&gt;__MailServerPort__&lt;/port&gt;
                      &lt;userName&gt;&lt;/userName&gt;
                      &lt;password&gt;&lt;/password&gt;
                      &lt;authenticationMethod&gt;__MailServerAuthenticationMethod__&lt;/authenticationMethod&gt;
                      &lt;startTls&gt;__MailServerSslOrTlsEnabled__&lt;/startTls&gt;
                      &lt;proxySettings ref="exm/eds/proxySettings" /&gt;
                  &lt;/smtpSettings&gt;
                  ...
              &lt;/eds&gt;
          &lt;/exm&gt;
      &lt;/sitecore&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>This is weird because the xpath in the match attribute is exactly the same as the <code>Mail Server Port</code> parameter for example... I've also tried to update the <code>parameters.xml</code> file as shown below.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;parameters&gt;
    &lt;parameter name="Mail Server" description="Mail server to enter into config" tags="Hidden,NoStore" defaultValue="__MailServer__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\Sitecore\.Smtp\.config$" match="//sitecore/settings/setting[@name='MailServer']/@value" /&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//*[local-name()='server']/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="Mail Server User Name" description="Mail Server User Name to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerUserName__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\Sitecore\.Smtp\.config$" match="//sitecore/settings/setting[@name='MailServerUserName']/@value" /&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//*[local-name()='userName']/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="Mail Server Password" description="Mail Server Password to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerPassword__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\Sitecore\.Smtp\.config$" match="//sitecore/settings/setting[@name='MailServerPassword']/@value" /&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//*[local-name()='password']/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="Mail Server Port" description="Mail Server Port to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerPort__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\Sitecore\.Smtp\.config$" match="//sitecore/settings/setting[@name='MailServerPort']/@value" /&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//*[local-name()='port']/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="EXM Mail Server SSL or TLS Enabled" description="EXM Mail Server SSL/TLS enabled to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerSslOrTlsEnabled__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//*[local-name()='startTls']/text()" /&gt;
    &lt;/parameter&gt;
    &lt;parameter name="EXM Mail Server Authentication Method" description="EXM Mail Server Authentication Method to enter into config" tags="Hidden,NoStore" defaultValue="__MailServerAuthenticationMethod__"&gt;
      &lt;parameterEntry kind="XmlFile" scope="App_Config\\Include\\EmailExperience\\Sitecore\.EDS\.Providers\.CustomSmtp\.config$" match="//*[local-name()='authenticationMethod']/text()" /&gt;
    &lt;/parameter&gt;
  &lt;/parameters&gt;
  </code></pre>
  
  <p>But this results in the same output... I can't find anything about any reserved names for the <code>userName</code> and <code>password</code> node names... </p>
  
  <p>This is driving me crazy as I can't find a solution. Now I hope anyone here has experinced this issue before and knows how to solve it. </p>
  
  <p>Kind regards,
  Jop Middelkamp</p>