Bug 16488 - xbuild preserves Items across the CallTarget boundary.
Summary: xbuild preserves Items across the CallTarget boundary.
Status: NEW
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-11-27 21:28 UTC by Fraser Ruffelll
Modified: 2013-11-27 21:29 UTC (History)
1 user (show)

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

sample script of the problem, logs from xbuild and msbuild. (1.78 KB, application/zip)
2013-11-27 21:29 UTC, Fraser Ruffelll

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 for Bug 16488 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Fraser Ruffelll 2013-11-27 21:28:26 UTC
When using CallTarget, any Items or Properties created within the called target should be destroyed when the flow control returns to the caller. This is not the case with xbuild, but is with msbuild.

In this simple example xbuild will generate the output "1;2;3;4;5;1;2;3;4;5" and msbuild will generate "1;2;3;4;5" as expected. I've attached the build script, and logs for xbuild ( and msbuild (4.0):

  <Target Name="CallTargetBug">
    <Message Text="Items in Collection before CallTarget: @(Collection) "/>
    <CallTarget Targets="TargetThatSetsCollection">
      <Output TaskParameter="TargetOutputs" ItemName="Collection" />
    <Message Text="Items in Collection after CallTarget: @(Collection) "/>
  <Target Name="TargetThatSetsCollection"
      <Collection Include="1;2;3;4;5" />

If you remove the 'Outputs' then xbuild outputs "1;2;3;4;5" and msbuild outputs nothing.
Comment 1 Fraser Ruffelll 2013-11-27 21:29:08 UTC
Created attachment 5558 [details]
sample script of the problem, logs from xbuild and msbuild.