title: How do I force MSDeploy API to keep an existing Connectionstring?
body: <p>We are deploying an ASP.Net application to IIS via MSDeploy API. We only want to update existing websites. In our ...pubxml we have defined following:</p>
  
  <pre><code>&lt;ItemGroup&gt;
    &lt;MSDeployParameterValue Include="$(DeployParameterPrefix)ConnectionstringA-Web.config Connection String"&gt;
      &lt;UpdateDestWebConfig&gt;False&lt;/UpdateDestWebConfig&gt;
    &lt;/MSDeployParameterValue&gt;
    &lt;MSDeployParameterValue Include="$(DeployParameterPrefix)ConnectionstringB-Web.config Connection String"&gt;
      &lt;UpdateDestWebConfig&gt;False&lt;/UpdateDestWebConfig&gt;
    &lt;/MSDeployParameterValue&gt;
  &lt;/ItemGroup&gt;
  </code></pre>
  
  <p>By default, the setParameters.xml created on publish, looks like this:</p>
  
  <pre><code>    &lt;setParameter name="ConnectionstringA-Web.config Connection String" value="metadata=res://*/itrDTO.csdl|res://*/itrDTO.ssdl|res://*/itrDTO.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=devServer;initial catalog=devDB;User Id=devUser;Password=devPW;MultipleActiveResultSets=True;App=EntityFramework&amp;quot;" /&gt;
      &lt;setParameter name="ConnectionstringB-Web.config Connection String" value="data source=devServer;initial catalog=devDB;integrated security=True" /&gt;
  </code></pre>
  
  <p>I also tried to create a "Projectname.wpp.targets" with this configuration inside my project:</p>
  
  <pre><code>&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"&gt;
    &lt;PropertyGroup&gt;
      &lt;AutoParameterizationWebConfigConnectionStrings&gt;false&lt;/AutoParameterizationWebConfigConnectionStrings&gt;
    &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>The result is that the connectionstrings are not created inside setparameters.xml.</p>
  
  <p>However, all combinations of configurations here are changing the connectionstrings inside the web.config on the destinationserver. This happens if we import the package by the IIS-ManagementUI AND when we deploy the package by MSDeploy API.</p>
  
  <p>All examples I've found for the "parameterization" - topic are for the IIS-Management process. As I understand parameterization, this is only usefull for manually installing updates, so that the admin has a UI to configure stuff. But we have no UI when we update the systems of our customers.</p>
  
  <p>Update:
  When I Publish with Visual Studio, here is the funny result:
  <a href="https://i.stack.imgur.com/bBzHd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bBzHd.png" alt="enter image description here"></a>
  I think this means "Hey WebDeploy, keep your hands off the connection strings!"</p>
  
  <p>When I preview the changes, this is the result:
  <a href="https://i.stack.imgur.com/Cx5Kn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cx5Kn.png" alt="enter image description here"></a></p>