title: Visual Studio: How to properly build and specify the configurations and platforms for x64 and x86
body: <p>Using: Visual Studio 2012 Professional and Ultimate with all latest updates</p>
  
  <p>How do I properly specify the configuration and platform to properly build x86 and x64.</p>
  
  <p>Visual Studio, when you first create a Winforms application gives you two configurations, Debug and Release, with AnyCPU defined as the platform.</p>
  
  <p>If you just target one platform, then the answer is easy, you go to the Build | Configuration Manager and select one of the platforms and then go to the project properties' build page and select the same platform (x86 or x64) and voila! You wind up with (say you want x86)</p>
  
  <pre><code>/bin/x86/Debug
  /bin/x86/Release
  </code></pre>
  
  <p>I have a solution with one application and multiple dependency projects (DLL assemblies).</p>
  
  <p>Since the VS Configuration Manager has two dropdown lists at the top, Configuration and Platform and then on the project level another configuration and platform, I did the following:</p>
  
  <p>(Before typing further, I think the whole setup sucks, but...)</p>
  
  <p>I created two new configurations Debug64 and Release64 using the top most dropdown and selected Mixed Platforms for the platform.</p>
  
  <p>I selected each of the four main solution configurations in turn and then set the project level configuration and project level platform to match, so:</p>
  
  <pre><code>Debug64 === Debug64, x64
  Release64 === Release64, x64
  Debug === Debug, x86
  Release === Release, x86
  </code></pre>
  
  <p>I then went into the project properties (Alt + Enter) build page, ignored the platform and selected each configuration in turn and then set the target processor to match. I changed the output to be the following:</p>
  
  <pre><code>Debug64: /bin/x64/Debug
  Release64: /bin/x64/Release
  Debug: /bin/x86/Debug
  Release: /bin/x86/Release
  </code></pre>
  
  <p>By default, Visual Studio uses the top platform to set the folder and the configuration name to set the last part of the output. If I save and close out of the project properties, then all seems fine. I can build, and wind up with the proper folders.</p>
  
  <p>The problem comes, when I switch solution configurations on the Visual Studio toolbar. The project properties build page reverts back to what it wants by default, namely, say, /bin/x64/Debug64 for both debugs and something similar for the release.</p>
  
  <p>What prompted me to write this issue is that the designer gets confused and cannot find the appropriate library.</p>
  
  <p>I would like to select from the Visual Studio solution configuration dropdown my desired target (Debug x64, Release x64, Debug x86, Release x86) and have it build.</p>
  
  <p>How do I do that? What am I doing wrong?</p>
  
  <p>Creating just two solution configurations, Debug and Release, does not work, because there is no solution platform dropdown, which then targets all sub-projects. Visual Studio has, it seems to me, way too many configurations sections and platform sections. Maybe I am just missing something.</p>