title: using MSBuild with VS2010-generated vcxproj file as target -- error MSB4066 ("attribute Label in element is unrecognized")
body: <p>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 or project changes, and it builds ok in VS2010 as expected.</p>
  
  <p>Then I created an MSBUILD project file as follows:</p>
  
  <pre><code>&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
      &lt;Target Name="Build"&gt;
          &lt;MSBuild Projects="TfsBuildTestTarget.sln" Targets="TfsBuildTestTarget" Properties="Configuration=Release;Platform=Win32"/&gt;
      &lt;/Target&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>When I run MSBUILD on this project file, I get the following error:</p>
  
  <blockquote>
    <p>"c:\dev\TfsBuildTestTarget\testBuild.proj"
    (default target) (1 ) ->
    "c:\dev\TfsBuildTestTarget\TfsBuildTestTarget.sln"
    (TfsBuildTe stTarget target) (2) ->
    (TfsBuildTestTarget target) -><br>
    c:\dev\TfsBuildTestTarget\TfsBuildTestTarget\TfsBuildTestTarget.vcxproj(3,14): 
    error MSB4066: The attribute "Label" in element  is unrecognized.</p>
  </blockquote>
  
  <p>The referenced line, in the (VS-generated) vcxproj file looks like this:</p>
  
  <pre><code>  &lt;ItemGroup Label="ProjectConfigurations"&gt;
  </code></pre>
  
  <p>The <a href="http://msdn.microsoft.com/en-us/library/ms164283.aspx" rel="noreferrer">reference for the MSBuild item element</a> does not include a Label attribute.</p>
  
  <p>What is going on here?  Why is VS2010 generating project files that do not appear to be compatible with MSBuild?  Is there a way for me to build this solution as part of an MSBuild project without manually tweaking the XML?</p>