using MSBuild with VS2010-generated vcxproj file as target — error MSB4066 (“attribute Label in element is unrecognized”)

后端 未结 2 850
情歌与酒
情歌与酒 2021-01-17 13:04

Using VS2010, I created a Win32 C++ console application called \"TfsBuildTestTarget\". This is just the default console application created by the wizard. I made no code o

相关标签:
2条回答
  • 2021-01-17 13:40

    I was using the "Open Visual Studio Command Prompt (2008)" entry of Start Menu to build, and it gave me the same error, but when I switched to "Open Visual Studio Command Prompt (2010)", I had the problem miracolously solved.

    0 讨论(0)
  • 2021-01-17 13:47

    Make sure you are using the .NET 4.0 version of MSBuild.

    If you use the .NET 3.5 version of MSBuild against a VS2010 solution that includes a vcxproj file you will get this error.

    I made a c++ console application like you specified and ran it using both .NET 3.5 and .NET 4.0 MSBuild versions. I got the error using 3.5 and it worked using 4.0.

    The Label attribute is new in .NET 4.0. It can be added to ItemGroup, PropertyGroup, Target, and other elements. The label attribute is not mentioned in the online help for msbuild but is defined int he msbuild 4.0 schema files.

    0 讨论(0)
提交回复
热议问题