title: How to conditionally deploy an app.config based on build configuration?
body: <p>I have three custom build configurations { Dev, Qs, Prd }. So, I have three app configs { Dev.config, Qs.config, Prd.config }. I know how to edit the .csproj file to output the correct one based on the current build configuration.</p>
  
  <pre><code>&lt;Target Name="AfterBuild"&gt;
     &lt;Delete Files="$(TargetDir)$(TargetFileName).config" /&gt;
     &lt;Copy SourceFiles="$(ProjectDir)$(Configuration).config" DestinationFiles="$(TargetDir)$(TargetFileName).config" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>My problem is, I need to have <strong>six</strong> build configurations { Dev, Qs, Prd } x { Debug, Release }. I need to support the debug and release settings (optimizations, pdb, etc) for each environment. However, the app config values don't change between debug/release.</p>
  
  <p>How do I keep the build script as generic as possible and use only the three app configs? I don't want to hard code too many conditional strings.</p>