title: How to use the final {project}.exe.config file when creating a setup project
body: <p>I have created a console application (blah.exe) with specific app.config's for dev and prod. These are named <code>dev_app.config</code> and <code>prod_app.config</code>. I have hooked up an <code>AfterBuild</code> target in my csproj file<sup>*</sup> which copies the correct config file to the bin directory as <code>blah.exe.config</code>.  </p>
  
  <p>I have also created a setup project for this console app but I have run into a slight issue. It seems that the setup project uses the actual <code>app.config</code> from the project directory as opposed to the final <code>blah.exe.config</code> (located in bin directory).</p>
  
  <pre><code>|--Bin
  |  |--Debug
  |     |--Blah.exe.config &lt;--- I want the setup project to use this file
  |--app.config &lt;--- Setup project uses this file at the moment
  |--dev_app.config
  |--prod_app.config
  </code></pre>
  
  <p><strong>How can I force the <em>setup project</em> to use the final config file generated in the bin folder and not the actual <code>app.config</code> file?</strong></p>
  
  <p><em>Additional Information:</em></p>
  
  <p><em>My current solution involves adding another <code>AfterBuild</code> command which overwrites the actual <code>app.config</code> file. I don't like approach since it forces me to have an additional file that I don't need. Also, having this file has caused me some grief already since I made changes to the <code>app.config</code> file which got overwritten when building. The question is about how to get the setup project use the final config file in the bin folder and <strong>NOT</strong> how to manage the config or ways to create a config file.</em>  </p>
  
  <p><sup>*</sup> Adapted from <a href="https://stackoverflow.com/q/350377/268667">Deploy an app.config based on build configuration</a></p>