title: MSBuild Error: The attribute "Remove" in element <ProjectReference> is unrecognized
body: <p>I'm attempting to setup a .csproj file to have a conditional item group which will remove all of the elements in the &lt;ProjectReference&gt; item group.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;ItemGroup&gt;
     &lt;ProjectReference Include="..\..\..\..\Projects\Registrar\Ucsb.Sa.Registrar.Common\Ucsb.Sa.Registrar.Common\Ucsb.Sa.Registrar.Common.csproj"&gt;
        &lt;Project&gt;{1EDDDE57-0181-41B4-B2AE-FB76450F85C8}&lt;/Project&gt;
        &lt;Name&gt;Ucsb.Sa.Registrar.Common&lt;/Name&gt;
     &lt;/ProjectReference&gt;
  &lt;/ItemGroup&gt;
  &lt;ItemGroup Condition="$(OnBuildServer) == 'true'"&gt;
     &lt;ProjectReference Remove="*" /&gt;
  &lt;/ItemGroup&gt;
  &lt;ItemGroup Condition="$(OnBuildServer) == 'true'"&gt;
     &lt;Reference Include="Ucsb.Sa.Registrar.Common"&gt;
        &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
        &lt;HintPath&gt;$(RegCommonDll)&lt;/HintPath&gt;
     &lt;/Reference&gt;
  &lt;/ItemGroup&gt;
  </code></pre>
  
  <p>But, when I load the project into VS 2008, I get the error message 'The attribute "Remove" in element &lt;ProjectReference&gt; is unrecognized". The odd thing is that the Remove attribute is in the schema (C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas\1033\MSBuild\Microsoft.Build.Core.xsd). There is MSDN documentation on it (<a href="http://msdn.microsoft.com/en-us/library/bb651786.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb651786.aspx</a>). And, there is a comment about it at the bottom of the MSDN article titled &quot;MSBuild Items&quot;.</p>
  
  <p>The .csproj file seems to be pointing to .NET 3.5; but I am unable to verify if that version of msbuild is being used to load the project (does anyone know how to do that?)</p>
  
  <p>First line of .csproj file:</p>
  
  <pre><code>&lt;Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  </code></pre>
  
  <p>PS. I got the idea to use the conditionals from <a href="https://stackoverflow.com/questions/857379/build-with-msbuild-and-dynamically-set-project-references">Build with msbuild and dynamically set project references</a></p>