MsBuild item evaluation surprise

Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /customers/c/b/1/cactcxjko/webroots/www/blog/wp-content/plugins/wp-syntax/wp-syntax.php on line 380 Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /customers/c/b/1/cactcxjko/webroots/www/blog/wp-content/plugins/wp-syntax/wp-syntax.php on line 380

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.

178 thoughts on “MsBuild item evaluation surprise”

  1. 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.

  2. 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.

  3. 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.

  4. The Olympus article brought back memories of my first digital camera. For anyone also dealing with an aging Windows PC, I recently looked into Radiant Optimizer as a cleanup tool after reading a guide on what it actually does, free vs Premium, and safety concerns. Worth researching before buying anything.

  5. Great article! As a fan of classic TV shows and movies, I always enjoy discovering new DVD and Blu-ray collections. Physical media remains a great choice for collectors who value quality and ownership. For anyone looking for DVD and Blu-ray box sets in the UK, DVD Wholesale UK offers a wide selection with free UK shipping.

  6. This dessert looks like the perfect summer treat—light, fruity, and so easy to throw together. Testing my screen for dead pixels afterward with a quick fullblackscreen check was a nice little reminder that even simple tools can save you from bigger display headaches later. Great recipe to bookmark for a hot weekend!

  7. Building a well-rounded agave collection takes patience, and honestly, a little daily ritual helps me wind down after tasting sessions. I’ve gotten oddly hooked on the jeffgoldblumle wordle game as a mental palate cleanser between sipping reposados and blancos. It’s a quirky three-guess challenge that keeps my brain sharp without overthinking.

  8. Great catch — that MSBuild quirk where ItemGroups evaluate even when their condition is false is genuinely counterintuitive and barely documented. I’ve hit similar surprises. It’s exactly the kind of gotcha worth capturing; I keep dev walkthrough videos searchable as transcripts with https://scriptmind.co so details like this don’t get lost.

  9. The heavy disk IO at startup rings familiar. Item evaluation surprises are the worst kind — nothing fails outright, the build just crawls, and you only find it by staring at a project file diff. Good that it turned out to be something you could pin down.

    I spent part of my week turning a stack of expense receipts into one file for a reimbursement portal. Shot them with my phone, ran them through LensUp to get a clean printable PDF, then set the compression to the size the portal asks for — it aims at that number but can land a bit over, so I checked before uploading. Files never leave the machine and the processing happens in the browser tab, which is why I went looking for a PDF scanner online free instead of installing another desktop app.

  10. A briga interna mostra como a bancada está dividida entre pressionar e negociar. Enquanto isso, quem gosta de desafio mental pode testar o krillion, um jogo grátis de perguntas onde só respostas incomuns pontuam. Sete rodadas de 25 segundos, sem cadastro. Curioso para ver se você acha a resposta única.

  11. The part about ItemGroup conditions still evaluating the glob even when false is a nasty gotcha — explains the disk IO spike when the property was empty. Good find with the Choose workaround. this resource

  12. This MSBuild ItemGroup evaluation behavior is subtle—thanks for documenting the Choose workaround. I’ve seen similar surprises with conditional evaluation in other pipelines. On an unrelated note, I’ve been testing https://reelmorph.app for photo-to-AI-video effects for TikTok/Reels; it handles prompt conditions differently but the debugging mindset is similar.

  13. Before scheduling a plumber, I photograph leaky fixtures and water damage to document the issue, but I keep worrying about hidden AI metadata in those images. If you need to Remove AI label from photos, doing it in the browser without uploading feels safer. Tulsa homeowners might find that useful when sending inspection pictures.

  14. That Choose/When workaround is a great catch—MSBuild evaluating items even when conditions are false is surprisingly non-obvious. I’ve seen similar eager-evaluation surprises in asset pipelines; keeping sprite outputs consistent across builds matters, which is why I like Generate Consistent Game Assets for one-project sprites, animations, sheets, and icons.

  15. had somehow caused the build to is the part I kept rereading. It makes the rest of the page feel less generic. For wedding planning notes I use idovite to keep timing and replies in one place, but here the writing itself is doing the work.

  16. Preserving a functional kitchen peninsula saves significant money while allowing for impactful decorative updates. One remodeling approach tears out the entire peninsula to install a trendy central island, triggering costly floor repairs and rerouted wiring. A more sensible alternative retains the peninsula structure and focuses strictly on refreshing the cabinet surfaces. Homeowners can compare how a rich walnut stain or painted sage finish modernizes the breakfast bar while leaving base cabinets, electrical outlets, and plumbing undisturbed. The peninsula continues serving daily meals while the fresh finish revitalizes the room. Previewing these decorative possibilities through the Kitchen Layout tool ensures that your functional layout remains protected while delivering a stylish new room.

  17. My initial rendering session produced an unexpected surprise with my plumbing fixtures. Testing a photo through https://kitchenlayout.net showed a stable kitchen, but earlier tools had shifted the basin across the room. The first image placed my stainless sink directly beneath the west window sash. A second pass moved that identical basin across to the east window near the pantry. My supply pipes and drain lines obviously cannot jump between exterior walls. Keeping the sink in its true spot prevents costly remodeling confusion. Realistic planning starts with leaving the plumbing right where it belongs.

  18. Showroom lighting often conceals how modern countertop materials will look against older cabinetry. Testing prospective surfaces through the Kitchen Layout tool showed me that a dark charcoal quartz clashed with my honey oak doors. Examine your kitchen photograph to confirm that the existing door frames, drawers, and window trim stay intact. In the bright store aisle, the sample looked sophisticated and clean. Set atop my worn cabinet boxes at home, the contrast felt harsh and uncoordinated. Visualizing the combination in my real room prevented an expensive purchasing mistake.

  19. We asked for clay splash and got slate doors on top of it. The oak veneer was already confirmed with the shop, so the extra paint was a change to a purchase. We redid it on https://kitchenlayout.net with the splash swapped and the veneer left exactly as ordered. Grout still stops where the floral used to stop. The confirmation in the drawer matches the doors on the screen. A picture can be confident and still unpick an order. Ours only needed to show clay beside oak. The slate version was ambition we didn’t have. Clay beside the confirmed oak was the only comparison that night.

  20. Artikel ini menarik kerana ia menyentuh realiti penjajaran politik baharu yang sering membingungkan pengundi biasa. Kadang-kadang kita perlukan cara mudah untuk fokus pada mesej, bukan sekadar bunyi. Saya sendiri guna AI vocal remover untuk asingkan vokal dan instrumental, membantu saya mendengar inti ucapan pemimpin dengan lebih jelas.

  21. My initial rendering session produced an unexpected surprise with my plumbing fixtures. Testing a photo through https://kitchenlayout.net showed a stable kitchen, but earlier tools had shifted the basin across the room. The first image placed my stainless sink directly beneath the west window sash. A second pass moved that identical basin across to the east window near the pantry. My supply pipes and drain lines obviously cannot jump between exterior walls. Keeping the sink in its true spot prevents costly remodeling confusion. Realistic planning starts with leaving the plumbing right where it belongs.

Leave a Reply

Your email address will not be published. Required fields are marked *