.net - MSBuild Error: The attribute "Remove" in element <ProjectReference> is unrecognized -
I am trying to set up a .csproj file to place a conditional item group that has all the elements in the & lt Will remove; ProjectReference & gt; Item group
For example:
& lt; Item group & gt; & Lt; Include in the context of the project = ".. .. .. .. .. .. .. .. Projects Registrar \ UCSB.System Registered. Common \ UCSB.See Registrar.Common \ UCSB.See Registrar. Common CPRjas "& 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; Item Group Status = "$ (On-Build Server) == 'True'" & gt; & Lt; Remove Project Reference = "*" /> & Lt; / ItemGroup & gt; & Lt; Item Group Status = "$ (On-Build Server) == 'True'" & gt; & Lt; Include in context = "UCSb.Sa.Registrar.Common" & gt; & Lt; SpecificVersion & gt; False & lt; / SpecificVersion & gt; & Lt; HintPath & gt; $ (RegCommonDll) & lt; / HintPath & gt; & Lt; / References & gt; & Lt; / ItemGroup & gt;
But when I load this project in VS 2008, I get an error message in the "attribute" element & lt; ProjectReference & gt; The invalid thing is that the Remove Specialty Schema (C: \ Program Files \ Microsoft Visual Studio 9.0 \ Xml \ Schemas \ 1033 \ MSBuild \ Microsoft.Build.Core.xsd) is in. There is an MSDN document on it (). And, there is a comment about this, titled "MSBuild Items" & quot; MSBD item & quot ;.
The .csproj file appears to be pointing to .NET 3.5, but I am unable to
the first line of the .csproj file:
& Lt; Project Tools version = "3.5" default target = "build" xmlns = "http://schemas.microsoft.com/developer/msbuild/2003" & gt;
PS I use this condition
Use the condition with Remove Attribute can not be used. Static items have been declared outside for those targets. You can only use this attribute inside dyn amyme item announcements have been found within the dynamic item declaration target. For example, take a look at the following script scripts.
& lt; Project Tools Version = "3.5" xmlns = "http://schemas.microsoft.com/developer/msbuild/2003" & gt; & Lt; ItemGroup & gt; & Lt; Include in the context of the project = "One.dll" /> & Lt; / ItemGroup & gt; & Lt; Target name = "demo" & gt; & Lt; ItemGroup & gt; & Lt; Remove Project Reference = "@ (Project Reference)" /> & Lt; / ItemGroup & gt; & Lt; Message text = "project reference: @ (project reference)" /> & Lt; / Target & gt; & Lt; / Project & gt;
Also keep in mind that you should not use Remove = "*" which will not remove everything, it will remove every file in the current file That item is included in the Project Reference item group if you want to clear an item, you will have to remove = "@ (project reference)" , where the project reference Item is
Comments
Post a Comment