This doesn't mean what you think it means:
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Notice the
Condition
attribute. This attribute will only make the section active if the condition is true. So that line is saying that if the build is initiated with the
Platform
property equal to
''
(e.g. empty string or not set), then fall back to setting the
Platform
property to
AnyCPU
.
This can sometimes happen when people run MSBuild.exe from the command line and use the .CSPROJ file directly. As far as I know, if you run devenv.exe or use the .SLN file from the command line, then the
Platform
property is always selected to a valid value (unless you do some major hacking on the .SLN file or do some acrobatics with adding and removing build targets using the Visual Studio UI.)
A the dirty little secret is that Visual Studio in GUI mode just sort of uses MSBuild.exe to build. It actually hosts its own build engine that more or less parallels the build engine used by MSBuild.exe. (If you run devenv.exe to build, it eventually falls back to using the same build engine used by MSBuild.exe.) Anyway, the theory is that the .CSPROJ reflects a consistent set of settings that both the GUI as well as MSBuild will use to build your project.
As for your second question, any x86 Windows binary should run on a x64 Windows. (This is why for several years, Microsoft Office had both 32-bit and 64-bit versions available on their release CDs and DVDs, but the default was to install the x86 even though the target OS was x64 bit. You had to explicitly install the x64 on the 64 bit Windows. MS had to deal with less support calls back then when 64-bit Windows was not as popular. Nowadays, I believe that it detects the target OS and selects the corresponding version of Office (unless overridden by a group policy to still force 32-bit).) Unfortunately, your screenshots for your second question just show black rectangle with some light colored splotches so we can't see what error you are getting or what behavior you are seeing.