title: How or why is MSBuild choosing the x64 platform when I don't specify it instead of AnyCPU?
body: <p>I'm running <code>msbuild.exe</code> via Rake from a regular PowerShell console. This is the command as printed from a diagnostic level run</p>
  
  <blockquote>
    <p>"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "D:/Projects/machine.specifications/Source/Machine.Specifications/Machine.Specifications.csproj31881140" /maxcpucount /target:Build /verbosity:diagnostic /property:Configuration=Debug /property:TrackFileAccess=false /property:BuildInParallel=false /property:BuildRunner=Rake</p>
  </blockquote>
  
  <p>And the build is failing because msbuild is picking <code>x64</code> as the <code>Platform</code>.</p>
  
  <blockquote>
    <p>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(483,9): error : The OutputPath property is not set for project 'Machine.Specifications.csproj37103470'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. <strong>Configuration='Debug' Platform='X64'</strong>. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.</p>
  </blockquote>
  
  <p>I'm not passing it in on the command line (or from the script). The <code>csproj</code> has a default configuration </p>
  
  <pre><code>&lt;Configuration Condition=" '$(Configuration)' == '' "&gt;Debug&lt;/Configuration&gt;
  &lt;Platform Condition=" '$(Platform)' == '' "&gt;AnyCPU&lt;/Platform&gt;
  </code></pre>
  
  <p>and two specific configurations</p>
  
  <pre><code>&lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&gt;
  &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "&gt;
  </code></pre>
  
  <p>So, I expected the <code>AnyCPU</code> platform to be selected. But, for some reason, something is picking or sending in <code>x64</code>. I don't think the Rake system is a problem here, I've seen this behavior before on raw cmd line calls to msbuild (but I haven't documented them).</p>
  
  <p>I'm on 64-bit Windows 7, calling msbuild 4.0. I don't know if that's relevant.</p>
  
  <hr>
  
  <p>I am <a href="https://powershellcx.svn.codeplex.com/svn/Trunk/Src/ReleaseNotes.txt" rel="noreferrer">loading</a> the 64-bit Visual Studio tools (<code>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64</code>) using <code>Invoke-BatchFile</code> in my PowerShell profile. Could that be the culprit?</p>
  
  <p>Why would msbuild deliberately choose x64 anyway? The 32-bit version doesn't choose x86 for you.</p>
  
  <hr>
  
  <p>*1: The PowerShell console is at <code>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe</code>
  *2: I'm running the <a href="https://github.com/machine/machine.specifications" rel="noreferrer">MSpec</a> build (here's the <a href="https://github.com/machine/machine.specifications/blob/master/rakefile.rb" rel="noreferrer">rakefile</a> and the <a href="https://github.com/machine/machine.specifications/blob/master/Tools/Rake/msbuild.rb#L40" rel="noreferrer">msbuild call</a>)</p>