A Little Batching Brainteaser
Every so often as we work through converting the Visual Studio builds over to MSBuild we stumble across a little quirk or entertaining bit of MSBuild XML that makes the team scratch its head. Dan sent this one around to the team a couple of weeks ago, and it's related to our previous post about unqualified metadata.
How many x's does the following MSBuild XML produce?
<
Project DefaultTargets="Build" xmlns=https://schemas.microsoft.com/developer/msbuild/2003>
<ItemGroup>
<Foo Include="a"/>
<Foo Include="b"/>
<Foo Include="c"/>
<Bar Include="a"/>
<Bar Include="b"/>
<Bar Include="c"/>
</ItemGroup>
<Target Name="Build">
<Message Text="@(Foo) @(Bar)" Condition="'%(Foo.Identity)'=='%(Bar.Identity)'"/>
</Target>
</Project>
To make it easier we'll make the question multiple choice. Is the answer:
a) 0
b) 2
c) 3
d) 9
No cheating! You can't run this through MSBuild to find out. Take a guess first, then try it out.
[ Author: Neil Enns]
Comments
Anonymous
January 25, 2006
a) 0
I don't see any 'x' in the XML :-PAnonymous
January 25, 2006
Hahahahaha :) Ok, I suppose that's technically correct. That's what I get for cleaning up Dan's original challenge.
Let me rephrase: How many lines of output does the following MSBuild XML produce?
NeilAnonymous
January 25, 2006
The comment has been removedAnonymous
January 25, 2006
That's definitely a reasonable guess, but not what the output winds up being (I'll explain why later :) Anyone else?
NeilAnonymous
January 25, 2006
The comment has been removedAnonymous
June 19, 2006
<a href='http://www.yahoo.com'></a> http://www.insurance-top.com/auto/">http://www.insurance-top.com/auto/ <a href='http://www.insurance-top.com'>auto insurance</a>. <a href="http://www.insurance-top.com ">Insurance car</a>: auto insurance, insurance car, Best Insurance Web site. [url]http://www.insurance-top.com/car/[/url] [link=http://www.insurance-top.com]insurance quote[/link] from site .Anonymous
June 19, 2006
http://www.insurance-top.com/company/">http://www.insurance-top.com/company/ auto site insurance. [URL=http://www.insurance-top.com]home insurance[/URL]: auto insurance, insurance car, Best Insurance Web site. [url=http://www.insurance-top.com]cars insurance[/url] from website .Anonymous
June 19, 2006
http://www.insurance-top.com/company/ auto site insurance. auto insurance, insurance car, Best Insurance Web site. from website .Anonymous
August 08, 2006
carinsurance <a href=http://carinsurance.undonet.com>carinsurance</a>Anonymous
August 10, 2006
autoinsurance <a href=http://autoinsurance.ibusinessdot.com/>autoinsurance</a>Anonymous
August 11, 2006
motercycle insurance <a href=http://motercycle-insurance.dreamstation.com/>motercycle insurance</a>Anonymous
August 13, 2006
ringtones freeAnonymous
August 14, 2006
auto insurence <a href=http://www.netcolony.com/auto-insurence>auto insurence</a>Anonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=msbuild-team-blog-a-little-batching-brainteaserAnonymous
June 09, 2009
PingBack from http://weakbladder.info/story.php?id=5291Anonymous
June 16, 2009
PingBack from http://lowcostcarinsurances.info/story.php?id=444Anonymous
June 17, 2009
PingBack from http://patioumbrellasource.info/story.php?id=1258Anonymous
June 19, 2009
PingBack from http://mydebtconsolidator.info/story.php?id=13029