Skip to content

Instantly share code, notes, and snippets.

@benvillalobos
Last active September 7, 2022 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benvillalobos/5b2bbe98a6e2a56994f65f4dbd170219 to your computer and use it in GitHub Desktop.
Save benvillalobos/5b2bbe98a6e2a56994f65f4dbd170219 to your computer and use it in GitHub Desktop.
Spelunking Through Binlogs

Spelunking Through Binlogs

This stuff ain't easy, so here's a WIP "get you up to speed" doc.

Setup

  • Install the MSBuild Log Viewer or use the online viewer.

  • File->Start Page, make sure this box is checked

    image

    When you search, you should see a breadcrumb trail like so:

    image

The Basics

  • Take a moment to read the notes under the search box, it's very useful. image

TL;DR: $property foo would find all properties named foo, or with the value of foo. I also find under(foo.csproj) to be very useful. Combining them can be powerful: $property foo under(bar.csproj), for example.

Finding The Definition of a Property

We can take advantage of XML here. Under the Find in Files tab, search <YourProperty. This would show you every single instance where YourProperty was being defined, no matter the file it was defined in.

Note: Properties are "last one wins," this includes Properties set in Targets. See How MSBuild builds projects for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment