Reputation: 31
Hello I'm having issues with an MSBuild Error. It was originally discovered while trying to setup an automated build through TFS but was tested against a local build using MSBuild.
The error occurs when attempting to build a VisualStudio 2013 project through the command line using MSBuild. The project builds fine when opened in VisualStudio. It is a simple project that builds against a Windows Embedded Compact 2013 SDK. I know that the .sln file and .vcxproj files are valid as they were created automatically though VisualStudio. In addition, they build just fine for all configurations from within VisualStudio.
Is there anything special that needs to be done for MSBuild to be able to use the SDK that I am specifying? The full text of the error (slightly edited to remove project names) is as follows:
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
Upvotes: 2
Views: 5886
Reputation: 31
I was able to resolve my issue today. The SDK's that I had installed where installed against the V12 MSBuild toolset. In the above error I was building against an older MSBuild version installed with the .net framework. By running the build against the correct toolchain it fixed the issue.
It was a similar problem for the automated build toolchain that I originally discovered the issue on. The automated build workflow that we had setup for TFS used the default template settings for TFS2012. This was building against an older version of the MSBuild toolset. Following the guide located here:
Building Visual Studio 2013 solutions with your TFS 2010 / 2012 Build Templates
I was able to update our TFSBuild workflow to select the correct toolchain for VisualStudio 2013 Builds.
Upvotes: 1