Bug 3055 - xbuild does not support ItemGroup and PropertyGroup elements in Targets
Summary: xbuild does not support ItemGroup and PropertyGroup elements in Targets
Status: RESOLVED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-01-25 07:43 UTC by Lex Li
Modified: 2013-11-15 16:49 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Code sampe and error.log (5.79 MB, application/x-zip-compressed)
2012-01-25 07:43 UTC, Lex Li
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Lex Li 2012-01-25 07:43:50 UTC
Created attachment 1266 [details]
Code sampe and error.log

I tested on the following two scenarios,

Mono 2.10.8 on Windows 7 SP1 x64
Mono 2.10.6 on openSUSE 12

In both cases, xbuild cannot properly handle Antlr3.targets.

This targets file works fine in Microsoft MSBuild 4.0.

Repeat steps:

1. Unzip the attached code base.
2. Execute "xbuild SharpSnmpLib.md.sln".

The full log I received on my Windows machine (error.log) is also included in the zip package.

====================================
Build FAILED.

Warnings:

D:\sharpsnmplib\SharpSnmpLib.md.sln:  warning : Don't know how to handle GlobalSection TeamFoundationVersionControl, Ignoring.
D:\sharpsnmplib\SharpSnmpLib.md.sln:  warning : Don't know how to handle GlobalSection SubversionScc, Ignoring.

D:\sharpsnmplib\SharpSnmpLib.md.sln (default targets) ->
(Build target) ->
D:\sharpsnmplib\Samples\C#\snmptrapd\snmptrapd.csproj (default targets) ->
C:\PROGRA~2\MONO-2~1.8\lib\mono\4.0\Microsoft.Common.targets (ResolveAssemblyReferences target) ->

	C:\PROGRA~2\MONO-2~1.8\lib\mono\4.0\Microsoft.Common.targets:  warning : Reference 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' not resolved

D:\sharpsnmplib\SharpSnmpLib.md.sln (default targets) ->
(Build target) ->
D:\sharpsnmplib\snmpd\snmpd.csproj (default targets) ->
C:\PROGRA~2\MONO-2~1.8\lib\mono\4.0\Microsoft.Common.targets (ResolveAssemblyReferences target) ->

	C:\PROGRA~2\MONO-2~1.8\lib\mono\4.0\Microsoft.Common.targets:  warning : Reference 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' not resolved

Errors:

D:\sharpsnmplib\SharpSnmpLib.md.sln (default targets) ->
(Build target) ->
D:\sharpsnmplib\SharpSnmpLib\SharpSnmpLib.AST.csproj (default targets) ->
D:\sharpsnmplib\SharpSnmpLib\..\lib\ANTLR\Antlr3.targets (AntlrCompile target) ->

	: error : Error initializing task ItemGroup: Not registered task ItemGroup.

	 4 Warning(s)
	 1 Error(s)

Time Elapsed 00:00:05.0880666
Comment 1 Mikayla Hutchinson [MSFT] 2012-01-25 10:59:24 UTC
This is a known limitation that xbuild cannot handle <ItemGroup> and <PropertyGroup> elements directly in Targets. One can use CreateItem and CreateProperty items to work around this.

I don't think we have a bug to track this, so changing the title.
Comment 2 Lex Li 2012-01-25 22:21:41 UTC
Thanks for pointing out the limitation. Will wait till this issue is fixed.
Comment 3 Lex Li 2012-01-25 22:22:52 UTC
Comment on attachment 1266 [details]
Code sampe and error.log

Need to run prepare.bat/.sh before compiling.
Comment 4 Mikayla Hutchinson [MSFT] 2013-11-15 16:49:28 UTC
This has been fixed.