Solved a problem with a build script last week. I had somehow caused the build to under some conditions take a very long time to start with heavy disk IO. After reviewing some recent changes I found the cause.
I had a ItemGroup that looked something like the following.
<ItemGroup Condition="'$(PathProperty)'!=''"> <SomeItem Include="$(PathProperty)/**/*.dll"/> </ItemGroup> |
Apparently MsBuild evaluates all ItemGroups even if the condition of the group or item evaluates to false. The result is just discarded if the condition evaluates to false. So the item above included all dll files on the entire hard drive when PathProperty was not set. By trial and error I found out that the condition of Choose elements are evaluated before the items they contain.
So to speed things up I changed the above to the following.
<Choose> <When Condition="'$(PathProperty)'!=''"> <ItemGroup> <SomeItem Include="$(PathProperty)/**/*.dll"/> </ItemGroup> </When> </Choose> |
Is this behaviour obvious to everyone else? Couldn’t find anything about it while reading the conditions documentation nor the documentation on items and properties on MSDN.
Ran into the same item evaluation gotcha last month — thanks for documenting it. I keep my dev notes at Way of the Hunter 2 Wiki.
For a Flamingo chapter lesson plan, tracking vocabulary density and reading time helps pacing. I use real-time character counting for worksheets, then check ??????? alongside line and paragraph counts. Since everything stays in the browser, student drafts are never saved or sent.
Well written and informative. Thanks for putting this together. Lagos Life Guide
Good read. If you want the artwork itself, the free library is at TikTok Banner
Captain Dave clearly knows how to put people on fish, which takes patience and timing. The same feel applies to aiming drills, where reading the moment matters more than rushing. I have been using okiaimx to practice peek timing and crosshair control, and it genuinely helps sharpen reactions.
Nice piece. There is a short browser version of the rite at Threshing Day Game
Solid write-up. The sourced timeline is at Pneumonic Plague News
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me? https://www.binance.bh/register?ref=IXBIAFVY
Classic MSBuild gotcha. Item evaluation order has bitten me more than once — good writeup of the behavior.
https://gemini-omni.dev/
Good article. The ideas in “MsBuild item evaluation surprise | Johan Appelgren” connect well with what I have been researching recently.
Browse animezerocodes.net
Thanks for sharing this. I found the discussion around “MsBuild item evaluation surprise | Johan Appelgren” useful, especially the practical context.
See animezerocodes.net
This was a helpful read. The way you explained “MsBuild item evaluation surprise | Johan Appelgren” made the main point much clearer.
Check out animezerocodes.net
Interesting MSBuild gotcha — the fact that ItemGroups are evaluated even when their condition is false is exactly the kind of subtle behavior that bites you in a long build. I ran into something similar when setting up an AI stem separation pipeline: the model (Demucs v4) is open-source, but getting PyTorch and GPU dependencies right locally was its own rabbit hole. Ended up using a hosted version instead — Demucs Online runs the same model on cloud GPUs, upload a track and get vocals, drums, bass and other stems in about a minute, no Python or local GPU required. Handy if you ever need clean stems without wrestling with the toolchain.