我有一个C#项目在Visual Studio 2010中,其预构建事件命令行为:
echo "$(Configuration)" - "$(PlatformName)" - "$(Platform)"
exit 1
结果如下:
"Debug" - "AnyCPU" - "AnyCPU"
尽管该窗口的宏部分表明在这种情况下
PlatformName
应该显示为Any CPU
(带有空格):http://i.imgur.com/xb3Y8.png(尽管MSDN似乎表明在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.
这里发生了什么?不幸的是,命令行上的“AnyCPU”不是一个有效的平台,所以我无法继续进行。使用
/property:Platform="Any CPU"
(有一个空格)可以正常工作。是否有其他宏可以使用,或者MSBuild有一些标志可以接受该平台?