您好,我遇到了MSBuild错误。它最初是在尝试通过TFS设置自动构建时发现的,但是使用MSBuild针对本地构建进行了测试。MS生成错误MSB8007:项目'MyProject.vcxproj'的平台无效。使用MSBuild针对自定义SDK构建Visual Studio项目
尝试通过命令行使用MSBuild构建VisualStudio 2013项目时发生该错误。该项目在VisualStudio中打开时可以正常工作。这是一个针对Windows Embedded Compact 2013 SDK构建的简单项目。我知道.sln文件和.vcxproj文件是有效的,因为它们是通过VisualStudio自动创建的。另外,它们适用于VisualStudio中的所有配置。
有什么特别的需要做的MSBuild能够使用我指定的SDK?该错误的全文(删除项目名称稍作修改)如下:
d:\TFS\Projects\MyProject>C:/Windows/Microsoft.NET/Framework/v4.0.30319/msbuild.exe MyProject.sln
Microsoft (R) Build Engine version 4.0.30319.18408
[Microsoft .NET Framework, version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 8/28/2014 3:55:14 PM.
Project "d:\TFS\Projects\MyProject\MyProject.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Am335xSDK".
Project "d:\TFS\Projects\MyProject\MyProject.sln" (1) is building "d:\TFS\Projects\MyProject\MyProject\MyProject.vcxproj" (2) on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'MyProject.vcxproj' is invalid. Platform='Am335xSDK'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [d:\TFS\Projects\MyProject\MyProject\MyProject.vcxproj]
Done Building Project "d:\TFS\Projects\MyProject\MyProject\MyProject.vcx
proj" (default targets) -- FAILED.
Done Building Project "d:\TFS\Projects\MyProject\MyProject.sln" (default targets) -- FAILED.
Build FAILED.
"d:\TFS\Projects\MyProject\MyProject.sln" (default target) (1) ->
"d:\TFS\Projects\MyProject\MyProject\MyProject.vcxproj" (default target)
(2) ->
(InvalidPlatformError target) -> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.InvalidP
latform.Targets(23,7): error MSB8007: The Platform for project 'MyProject.vcxproj' is invalid. Platform='Am335xSDK'. You may
be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [d:\TFS\Projects\MyProject\MyProject\MyProject.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.08