title: web.config transformation based on solution configuration
body: <p>Morning/afternoon/evening all.</p>
  
  <p>I am trying to apply a web.config transformations as part of a Jenkins build. I have got the transformation running by adding the following to my csproj:</p>
  
  <pre><code>&lt;Target Name="BeforeBuild"&gt;
      &lt;TransformXml Source="Web.config" Transform="Web.$(Configuration).config" Destination="Web.config" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>Which is great except for the fact that it now transforms the file when the solution is run locally. So I tried to prevent this by adding a condition to ONLY apply transformations for Jenkins builds. I added a solution configurations, set up the publish profile to use this, then tried to add a condition...</p>
  
  <p><img src="https://i.stack.imgur.com/42Pxb.png" alt="Solution configuration dropdown"></p>
  
  <pre><code>&lt;Target Name="BeforeBuild"&gt;
      &lt;TransformXml Source="Web.config" Transform="Web.$(Configuration).config" Destination="Web.config"  Condition="'$(Configuration)' == 'Debug Build'" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>...and...... it no work :-(.</p>
  
  <p>In fact transformations completely stop working when this condition is added (I can assert this by changing solution configurations locally and building and observing that the local web.config file is never changed, no matter which option is selected).</p>
  
  <p>How do I get transformations run when and only when the solution configuration is set to 'Debug Build'?</p>
  
  <p>Thanks in advance.</p>