I have a C# project in Visual Studio 2010 with this in the pre-build event command line:
echo "$(Configuration)" - "$(PlatformName)" - "$(Platform)"
exit 1
and the results are:
"Debug" - "AnyCPU" - "AnyCPU"
even though the macro section of that window suggests that PlatformName
should appear as Any CPU
in this case (with a space): https://i.stack.imgur.com/yzplE.png (even though MSDN seems to suggest that there is no space at http://msdn.microsoft.com/en-us/library/42x5kfw4.aspx).
msbuild /property:Configuration="Debug" /property:Platform="AnyCPU"
1>MyProgram.sln.metaproj : error MSB4126: The specified solution configuration "Debug|AnyCPU" is invalid.
What's going on here? Unfortunately, "AnyCPU"
is not a valid platform on the command line, so I am unable to proceed. The above works just fine with /property:Platform="Any CPU"
(with a space).
Is there another macro I can use, or some flag for MSBuild to accept the platform anyway?